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

Aishwarya Rajan April 16, 2018

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

0 votes
Deep (TechTime Initiative Group) July 22, 2021

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. 

0 votes
mzhydenko January 8, 2019

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

I have the same one

0 votes
Bob Moore April 16, 2018

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.

Aishwarya Rajan April 16, 2018

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?

Bob Moore April 16, 2018

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.

Aishwarya Rajan April 17, 2018

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.

Suggest an answer

Log in or Sign up to answer