Is there a way to import users from csv file in jira?

ShamhoonJ March 8, 2013

I am new to jira, everytime I need to give access to a user I need to manually create them, it there a way to automate from a feed file?

5 answers

1 accepted

1 vote
Answer accepted
Bob Swift (personal)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2013

  1. JIRA Command Line Interface has a couple of ways. You can use the addUser action. Use that in combination with the runFromCsv action. The csv file will need a header row something like:
userId, userEmail, userFullName, userPassword

An example would be

jira --action runFromCsv --common "--action addUser" --file my.csv


Andrian F
Contributor
January 6, 2017

Hi Bob,

       Will this allow us to add users to different "User Directories" ? or this works only for Iira-Internal Directory ?

 

Thanks

Andrian

Philipp Messerli
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 4, 2021

Hi,

I just tried it but only receive this error:

Client error: Invalid url: /rest/api/latest/field

 

What is not correct ?

 

Thanks

Philipp

0 votes
IT MayaHTT April 7, 2015

Hi Linus,

 

Yes you can do it, make sure you CSV has the following columns in a specific order :

 

userId, userEmail, userFullName, userPassword

If you don't fill UserPassword column it will generate a generic password.

 

Download JIRA Cli on your JIRA machine https://bobswift.atlassian.net/wiki/display/JCLI/Downloads

Extract you package on your JIRA machine and grant execute permission on Jira.sh script (chmod +x jira-cli/jira.sh)

Make sure you can connect to the server by editing jira.sh settings, should look like the following :

/opt/atlassian/jira/jre/bin/java -jar `dirname $0`/lib/jira-cli-4.0.0-SNAPSHOT.jar --server http://localhost:8080 --user admin_usr --password=root_password "$@"

Then, run the following command to import users in Jira based on the CSV file that you've imported :

 

./jira.sh --action runFromCsv --common "--action addUser" --file /path/Export.csv
 

This will create all users from your CSV file and they'll receive an email asking to connect and change their password.

 

Hopte it helps !

 

John

Linus Lindroth
Contributor
April 7, 2015

Hm...did you not read my question? Is there a way of doing this without buying a plugin? The JIRA CLI costs money. User handling in JIRA kind of sucks.

IT MayaHTT April 7, 2015

Yes the plugins is not free, but I didn't pay for it and was able to proceed anyway. You can also use the free trial. Don't install it on your Jira instance (Web) but try what I suggested for the import, it should do the job.

Like Aadesh Kolte likes this
Linus Lindroth
Contributor
May 11, 2015

Hi again. I tried this once more but it complaints about the following since I have not installed the plugin in JIRA (which I don't want because it isn't free): Client error: CLI connector is not installed or enabled on the server. See https://bobswift.atlassian.net/wiki/display/ACLI/Installation+and+Use.

0 votes
Linus Lindroth
Contributor
April 7, 2015

Hi

Is there no way of doing this without bying a plugin? For example by using psql commands directly to the database or something?

Or can it be scripted using the REST api?

Peter Andreasson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 25, 2016

Did you find a solution?smile

Linus Lindroth
Contributor
May 25, 2016

No not really sad

0 votes
IT MayaHTT September 17, 2014

I got it working following your instructions !! Thanks Bob !

0 votes
IT MayaHTT September 17, 2014

Hi Bob,

 

We are also trying to do this since we have thousands of customers and we don't want to do this manually (we only allow issue creation for existing JIRA users).

I've installed JIRA CLI on the machine, and trying to run the command above a suggested but could you please guide me how I can specify in the command which column in my CSV to use with needed parameters (display name, etc.).

We just need to fill username, full name and email address. I guess they'll get a temporary password ? Can I also notify them at the account creation.

 

I'm sorry for all these questions, it would be cool to have this integrated in JIRA so as the issues/projects CSV import already present.

 

Thanks in advance for your help.

Jonathan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events