How to do it...

Before we can start using the command-line client to import users into Jira, we first need to prepare our user data. The easiest way to do this is to create a comma-separated values (CSV) file containing the following information, in the order specified. You can use a spreadsheet application such as Microsoft Excel to create it:

Username Password Email Full name Group A
tester1 xxxxx [email protected] Test User jira-softwareusers

 

The following list explains each column of the CSV file:

  • Username: The username of the user; note that usernames in Jira need to be unique.
  • Password: The password for the new user. You can leave it blank, and let Jira automatically generate one for you.
  • Email: The email address for the new user. Emails can be sent out to the user for him/her to reset the password once the account is created.
  • Full name: The full name of the new user.
  • Group: Groups to add the new user into. If you want to add the user to multiple groups, put each group into its separate column. Note that the group name you specify must already exist in Jira.

Now that you have your data file, go through the following steps to import and create the user accounts in Jira:

  1. Unzip the CLI Client into a directory on your computer (for example, /opt/cli).
  2. Copy the user's CSV file to a directory on your computer (for example, /tmp/users.csv).
  3. Open a Command Prompt and navigate to the directory that contains the CLI Client—that is, the directory that contains the jira.sh  or jira.bat file.
  4. Make sure that the jira.shfile (Linux) or jira.bat (Windows) file is executable.
  5. Run the following command to import users; make sure you substitute the administrator username and password in your Jira URL:
./jira.sh --action addUserWithFile --server
http://localhost:8080 --password <password>
--user <username> --file /tmp/users.csv
The preceding command assumes you are using Linux. If you are using Windows, use jira.bat instead.

If everything runs fine, you will see an output similar to the following one on your console:

The result of the command, as shown in the preceding output, will show every new user added to Jira as defined in the CSV file. Since we did not specify a password for the Tester Four user, the user is assigned an autogenerated password. The last line in the output also provides a summary of the number of users added successfully and the number of failed ones, if any.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.20.125