Issue Summary
In versions of Jira prior to 10.0, the /rest/api/2/user/search endpoint supported fetching up to 1000 users per request and allowed proper pagination through the startAt parameter. However, in Jira 10.x, the following regressions have been observed:
This is reproducible on Data Center: Yes
Steps to Reproduce
- Ensure more than 100 users exist in Jira.
- Execute the following REST API calls:
- Call 1:
https://{baseurl}/rest/api/2/user/search?username=.&startAt=0&maxResults=100
- Expected: Returns 100 users.
- Actual: Returns 100 users. (Expected behavior)
- Call 2:
https://{baseurl}/rest/api/2/user/search?username=.&startAt=0&maxResults=110
- Expected: Returns 110 users.
- Actual: Returns only 100 users.
- Call 3:
https://{baseurl}/rest/api/2/user/search?username=.&startAt=100&maxResults=50
- Expected: Returns users 101–150.
- Actual: Returns no results or incorrect results.
Expected Results
The /rest/api/2/user/search endpoint should:
- Support retrieving more than 100 users per request when maxResults is set higher than 100 (e.g., 110).
- Allow proper pagination using the startAt parameter to fetch subsequent batches of users.
- Return users starting from the specified startAt index when combined with maxResults.
Actual Results
The /rest/api/2/user/search endpoint:
- Limits results to a maximum of 100 users, regardless of the maxResults parameter value.
- Does not properly handle the startAt parameter for pagination, returning either no results or incorrect results beyond the first 100 users.
Workaround
- Use Username Filters to Fetch Subsets of Users
By applying filters to the username parameter, you can retrieve smaller subsets of users and manually aggregate the results. For example:https://{baseurl}/rest/api/2/user/search?username=a*&startAt=0&maxResults=100
- Query the Jira Database Directly
If direct access to the Jira database is available, the customer can query the cwd_user table to retrieve all users. Example query:SELECT user_name, display_name, email_address FROM cwd_user WHERE active = 1 ORDER BY user_name ASC LIMIT 100 OFFSET 0;
- causes
-
JRASERVER-78660 Enhance Jira 10's User Search Endpoint to Return more than 100 Results
- In Progress
- is related to
-
JRASERVER-78926 Group display broken in user picker in UI
- Gathering Interest
- is duplicated by
-
BORG-1159 Loading...
- mentioned in
-
Page Loading...