Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

jira rest api - to fetch list of all the jira users

Hi Community,

I need to fetch a list of all the users who use JIRA..basically the list that is present in the user management section. I am using the below api..

http://domain-name/jira/rest/api/2/user/search?startAt=0&maxResults=1000&username=.

or 

http://domain-name/jira/rest/api/latest/user/search?startAt=0&maxResults=1000&username=.

but the issue is..this api lists only 1000 users by default even if the list contains more than 1000 users (2000 in my case). When I change the startAt and maxResults value as 1000 and 1000 respectively, i.e

http://domain-name/jira/rest/api/2/user/search?startAt=1000&maxResults=1000&username=.

 

it shows an empty list ..which clearly indicates that the api displays only 1000 results by default even if we loop through the result to get the entire list.

Is there any way through which I can fetch the entire list of users's details? any leads would be highly appreciated.

3 answers

You need to specify an argument such as the username. E.g the value 'a'. Iterate through the rest of the letters in the alphabet and concat all of the users to get the entire list.

if thats the case..I have 2000 users and Its not a good idea to fetch 2000 users individually as wildcards doesn't work for username argument here..so..I cant fetch all the users whose username starts with "a"..and do the same for rest of the alphabets. Can you suggest any other possible way?

It actually uses autocomplete so if you enter a, it will get all usernames that start with an a.

Other than this, it doesn't look like there is another way. https://jira.atlassian.com/browse/JRACLOUD-29069 shows that this is an issue in a lot of environments. You could try using one of the other suggested wildcards detailed in the issue.

I tried to do this 

 

http://domain-name/jira/rest/api/latest/user/search?startAt=0&maxResults=1000&username=a

 

it again shows 1000 results and also whose usernames doesn't start with a.

hi, did you manage to get rid of the issue?

I have the same one

You can try this end point: 

http://localhost:2990/jira/rest/user-management/1.0/users

As mentioned by one of the users here, it does work with Jira Server v8.5. I haven't personally tried it for Jira. 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you