How to get all users in jira using rest api

sonika jain September 10, 2015

Hello Everyone !!

I want the list of all user in JIRA account (online) using rest api or want to search user based on email address.

I am trying to get this using below url but this is retuning empty  "[0]" values

https://testjira.atlassian.net/rest/api/2/user/search?username=sonika.jain@test.com

Please suggest

 

4 answers

1 vote
Krishna Prasad PS October 11, 2017

Hi,
It is possible to get the list all users (may be with in the limit of maximum returnable results). We need to use the search API.
https://servername/rest/api/2/user/search?username=%


The wildcard character to be used for this purpose is "%".

Max Makhrov June 21, 2018

https://servername/rest/api/2/user/search?username=%

or 

https://servername/rest/api/2/user/assignable/multiProjectSearch?projectKeys=KEY1,KEY2,KEY3

 

Both requests give me active users only. How about all users?

Like # people like this
Anuradha October 2, 2018

what if users are more than 1000 ?Is it working if startAt=1000 and maxResults=2000?

It's not working for me.

Paul Y December 3, 2018

Try ...username=.   (dot)

Stefan Schwaha May 13, 2019

"_" stopped working for me with jira cloud. but a "+" instead did the trick

Like # people like this
Kyle McCauley May 24, 2019

"+" seems to stop at 100 results. Even using pagination with maxResults=100 and startAt=50 seems to have it stop at the same 100 users each time. 

 

IE: rest/api/3/user/search?query=+&maxResults=100&startAt=0  puts me somewhere in the T's for my users. Then using rest/api/3/user/search?query=+&maxResults=100&startAt=100 produces a blank request. There are definitely users missing. I've tried increasing maxResults to 1000 with no luck. 

Like # people like this
Tommy_Gingras May 30, 2019

Hi,

We are having the same trouble : 
https://url.atlassian.net/rest/api/3/user/search?startAt=0&maxResults=1000&username=+
Returns the 100 first entries

but
.atlassian.net/rest/api/3/user/search?startAt=100&maxResults=1000&username=+

returns nothing...

@Kyle McCauley did you find a workaround ?

Like Andrew Goss likes this
Kyle McCauley May 31, 2019

@Tommy_Gingras  

I have not at this point in time. I tried using some of the old "get all" queries by replacing the '+' with _@, . , and ? with no luck. 

Kyle McCauley May 31, 2019

@Tommy_Gingras I did find a workaround. You can use the group/member search:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-group-member-get

 

You'll have to use pagination to iterate through as they only return 50 results, but I do see all of my users now. The Jira-Users is the default group which I believe every user should be a part of from my understanding. 

https://yoururl/rest/api/3/group/member?groupname=jira-users&startAt=100

Tommy_Gingras June 3, 2019

Thanks for your answer,

 

That route required to be admin, but unfortunately my profile isn't :( 

 

{
"errorMessages": [
"You are not authorized to perform this action. Administrator privileges are required."
],
"errors": {}
}
0 votes
Jaime S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 10, 2015

Hi, Sonica.

About getting all the users, this should give you some information:

https://answers.atlassian.com/questions/140370

Kind regards,
Jaime Kirch da Silveira
Atlassian Cloud Support

0 votes
Taha Khanzada
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.
September 10, 2015

Hi Sonika,

I am not sure if you can get all users from JIRA rest api, but surely you can search user by username, email id or text from below query

If you are running this directory in browser then make sure you are logged in to JIRA before running this.

You will get Empty value also if there is no user with that email id or name.

I have tested using CURL and running in browser both are working

curl -u testjira:testjira https://testjira.atlassian.net/rest/api/2/user/search?username=sonika.jain@test.com

Taha

Suggest an answer

Log in or Sign up to answer