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

This widget could not be displayed.
Gregor Kasmann Community Champion Nov 07, 2017

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Apr 22, 2018 in Jira Software

How-to setup a secured Jira Software 7.9.0 on Ubuntu 16.04.4 in less than 30 minutes

...PermissionsStartOnly=true User=www-data Group=www-data ExecStart=/opt/jira/bin/startup.sh ExecStop=/opt/jira/bin/shutdown.sh TimeoutStartSec=120 TimeoutStopSec=600 PrivateTmp=true [Install] WantedBy...

1,046 views 5 10
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