I got thru the below API that retrieves users from a JIRA Project but limits it to 100 even when the maxResults is set to "250".
I used the below API:
/rest/api/2/user/assignable/multiProjectSearch
and am passing the below parameters
projectKeys=RPSO&startAt=0&maxResults=250
Appreciate if you can please help me in getting all the users. Also is there a way I can retrieve last login time for each of the user?
The multiProjectSearch
API limits results to 100 (it's the hard limit), so it has no effect even if you set a higher value. To retrieve all users, you need to paginate through the results by incrementing startAt
in multiples of 100.
You can use a loop to fetch users until there are no more results
rest/api/2/user/assignable/multiProjectSearch?projectKeys=<project-key>&startAt=0&maxResults=100
Start with a base value and keep increasing startAt
by 100 (startAt=100, startAt=200 and so on) until you receive fewer than 100 users.
To obtain last login times, use the Get User API: /rest/api/2/user?username=<username>
I hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.