How do I get users list using REST API?
I need to get All users in one call
Community moderators have prevented the ability to post new answers.
thanks for commenting, best option we have found in REST is:
https://servername/rest/api/2/user/search?username=a
Which return all users that has 'a' somewhere, but doing it on the entire ABC is ugly... We couldn't find a way to query for multiple letters....
try using wildcard: username=a*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://your-domain.atlassian.com/rest/api/2/user/search?username=&startAt=0&maxResults=10000
This is what you want. It searches a blank string in all users and blank string is present in all the strings, so it works fine ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Abhinav Bajpai This does not work as it only returns 100 results. Using Pagination to change the startAt value does not work either. All calls stop at 100 results whether you use startAt=99 or startAt = 0.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
according to documentation, the param "maxResults" can be set to a maximum of 1.000 . If the value is higher, as in above example its 10.000, the it defaults to 100.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Im using Jira Cloud, can anybody confirm, how it behaves on Jira Server?
In past it was working with:
`https://servername/rest/api/2/user/search?username=.&startAt=0&maxResults=1000`
"username = ." (dot)
Does this still work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jens Rosemeier Ohh, thanks for the information, actually I faced the same limit issue and scrolled using startAt but totally forgot about this comment :P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for it in self.projects:
size = 100
initial = 0
'''
JIRA API pushes only 100 results at a time so putting a while
loop to fetch whole data in batch of 100s
'''
while True:
start = initial * size
try:
issues = self.jira.search_issues('project={} and updated > -{}m and updated < 0m'.format(it.id, self.diff),start,size,expand='changelog')
print("Issues of new proj: " + str(it.key))
if len(issues) == 0:
break
initial += 1
#Iterate on all updated issues
for issue in issues:
This python code uses the jira api and fetches in batch of 100 till it gets 0 results in response
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It is possible to get the list all users (may be with in the limit of maximum returnable results). We need to use the search API.
https://servername/rest/api/2/user/search?username=%
The wildcard character to be used for this purpose is "%".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I noticed this now. It did indeed work on Jira Cloud instance just recently it stopped working.
What i noticed (undocumented), on Jira Cloud to get all users without filter, it must be called like:
`https://servername/rest/api/2/user/search?username=`
Empty value.
This is different to Jira Server instances.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As of today this is not possible with REST, please vote *and* comment on https://jira.atlassian.com/browse/JRA-29069-- explaining the need for it. If enough people are explaining the business need for this, Atlassian will fix this. It is not hard to fix, it's much hard to get the required attention for having this scheduled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for commenting, best option we have found in REST is:
https://servername/rest/api/2/user/search?username=a
Which return all users that has 'a' somewhere, but doing it on the entire ABC is ugly... We couldn't find a way to query for multiple letters....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think the Rest API has this ability. As far as I know you'll have to choose a different way, for example you could use the Soap API to do so as shown in this question JIRA SOAP API : get the list of users. Another way might be querying the DB directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No REST API returns all users in a single call if you have more than 1000 users. I would recomend the multiprojectsearch api in the document John pointed you to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Elad,
You didn't actually state which application you wanted to get a list of users from, but hopefully this document will be of some use to you as it explains how to use the API and also documents the APIs of the different Atlassian products: https://developer.atlassian.com/display/REST/REST+API+Developer+Documentation
All the best,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.