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.
Thank you @Tuncay Senturk ,
I tried the below
/rest/api/2/user/assignable/multiProjectSearch?projectKeys=<project-key>&startAt=100&maxResults=200
It still retrieves the same result set (same results as startAt= 0) and the results are limited to 100. Please suggest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure you tried the below two URLs?
1. rest/api/2/user/assignable/multiProjectSearch?projectKeys=<project-key>&startAt=0&maxResults=100
2. rest/api/2/user/assignable/multiProjectSearch?projectKeys=<project-key>&startAt=100&maxResults=100
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.