Why rest API "/rest/api/latest/user/search?username=." can't retrieve more than 1000 users?

Hi,

I am having a jira server of version 7.3.3 and there are 13008 users in it. I am fetching the users using the rest api "/rest/api/latest/user/search?username=." in paginated format fetching 200 records at a time.  

After getting 1000 records, jira is not returning any records further. So can you tell me why jira does not return more than 1000 users? And how can I retrieve all my users using jira rest api?

 

Thanks

1 answer

You can use a workaround below:

1. Get all users

host-name/rest/api/2/user/search?startAt=0&maxResults=1000&username=a
host-name/rest/api/2/user/search?startAt=0&maxResults=1000&username=b
host-name/rest/api/2/user/search?startAt=0&maxResults=1000&username=c
...
host-name/rest/api/2/user/search?startAt=0&maxResults=1000&username=z

 2. Filter only unique users

Even if I use the above rest api and my system has more than 1000 users starting with the character "a", as soon as my startAt parameter reaches to 1000, I do not get further users from Jira.

My rest api where I try to fetch more than 1000 users starting with character "a" the rest api looks something like this "/rest/api/latest/user/search?startAt=1000&maxResults=200&username=a". This return me an empty list.

My Jira server has 1115 Jira users starting with "a".

The very fact that this answer is probably the only correct answer gives me cancer.

I thought I would be slick and try rest/api/2/user/search?username=.&includeInactive=false&maxResults=1000&startAt=999

Yeah, that returns one user.

O.

M.

G.

 

I mean, I guess I can see where they are more GUI oriented... but wow.  All of their other startAt works as intended...

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

675 views 4 15
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot