Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating multiple Jira users via the REST API

Gary Pasquale
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.
December 6, 2018

Hi,

Looking for some guidance on how to create multiple Jira users via the REST API.

I've seen the response to this question but it only covers a single user.

I'm looking to create 2k unique users in one go.

 

Thanks in advance!

Regards,

Gary

2 answers

2 accepted

1 vote
Answer accepted
Dave Theodore [Coyote Creek Consulting]
Community Champion
December 6, 2018

The easiest way is to use the Jira CLI. It handles the WebSudo so you don't need to deal with that manually. There are examples in the documentation to help you get started. We use this a lot when we do this sort of thing. It's a really powerful admin tool, so I recommend it highly.

Gary Pasquale
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.
December 7, 2018

Hi @Dave Theodore [Coyote Creek Consulting]

I'm aware of the CLI and that was my first choice.

However, the environment that I'm connecting to isn't allowing a connection via the CLI.

Our server is hosted by a 3rd party, so rather than wasting further time on that I'm interested about how to do it via the API.

Thanks,

Gary

Dave Theodore [Coyote Creek Consulting]
Community Champion
December 7, 2018

Hmm... The Jira CLI uses the REST API, so it should work.  

It's a bit more painful to do this in the native API, since you will need to deal with creating a cookie, passing websudo and referencing the saved cookie for future connections.  Check this post for some help there using curl. You can add to the bash example or use it as a guide to do this in your favorite scripting language. You will need to create an array containing the minimum requirements for user creation for each user, then pass each element to the appropriate switch in the curl command. It's messy business to do this in bash, so you would be better off using python or something that has more advanced array handling capability.  Check the REST documentation to understand how the methods work. You'll at least need the "user" and "group" methods. Good luck!

0 votes
Answer accepted
Thomas Deiler
Community Champion
February 20, 2019

Dear @Gary Pasquale ,

I just wrote an article on this. Very simple and without fighting with cookies ...

How-to create multiple users in Jira with one batch run

So long

Thomas

Suggest an answer

Log in or Sign up to answer