Paging is broken for user/search queries

Seb Duggan January 25, 2018

It seems that paging and startAt for /rest/api/2/user/search is broken.

We have more than 1000 Jira users. It is however impossible to get past the 1000th user when querying the REST API.

The documents correctly say that maxResults is limited to 1000 records. Fine; so use startAt to get the second page and beyond, right?

However, if I try the following:

/rest/api/2/user/search?username=.&maxResults=1000&startAt=1000

...I get 0 results. If I try:

/rest/api/2/user/search?username=.&maxResults=1000&startAt=990

...I get 10 results.

Basically, even though I have more than 1000 users, the API results are always cut off at the 1000th.

I've seen this question raised before, but no answer was forthcoming, so I thought I'd raise it again...

(Jira version is 7.3.1)

1 answer

0 votes
josh
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.
January 25, 2018

This isn't a bug. The limit really is 1000 no matter where you start at.

If you're on Server, there's a way to defeat the 1000 record maximum. https://confluence.atlassian.com/adminjiraserver076/limiting-the-number-of-issues-returned-from-a-search-view-such-as-an-rss-feed-941596303.html

Make sure you lock this down to a specific group (just your api account probably) as mentioned in the doc. Overriding the limit and frequent use of 1000+ record queries will be a performance hit while running.

Seb Duggan January 25, 2018

Thanks Josh.

 

So you're saying that there's no way to get the 1001st record, unless you configure the max limits in the config file?

(However, we are on Server, so I'll look into getting that changed...)

josh
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.
January 25, 2018

Pretty sure that overriding this is the only way. I have an "unlimited-search" group in my jira local directory, and the accounts I do API work with are in it.

-Josh

Seb Duggan January 25, 2018

I'm just in the middle of creating a group called "unlimited-search"!

Like Majo likes this

Suggest an answer

Log in or Sign up to answer