I am trying to get a list of users in jira i am using the api
You need to loop through till you get 0 count for users.
Assuming you are using python
payload = {'startAt': 0, 'maxResults': 1000}
while True:
call the api end point
Get number of users returned.
if number of users == 1000:
payload['startAt'] += 1000
else:
break
hope this helps
@Vishal Biyani hello sir will there be a case where number of users are more than the the number i set in maxresuts? because when we are fetching issues we get a total so we can run a while loop on that as we now the total numbr of issues but here i am confused about that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use this end point, with startAt=0 and maxResults=1000
https://your-domain.atlassian.net//rest/api/3/users?startAt=0&maxResults=1000
Say you have 1500 users.
in the first call when response.json() length is calculated it will return 1000.
2nd call will be
https://your-domain.atlassian.net//rest/api/3/users?startAt=1000&maxResults=1000
this will give the array length at 500 and this will be termination condition for the while loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried this end point? -> https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-bulk-get
This gives a paginated list..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello @Fazila Ashraf i did look at the endpoint but the doubt i have is the endpoint you mentioned Returns a paginated list of the users specified by one or more account IDs. but i was looking to fetch all the users. and its not returning the total number of users like we get when we are fetching issues. my doubt was when i am getting all users we dont get a total field there so how would we fetch all the users that are there?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.