Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get All users API without query, username parameters

Anand Elumalai February 19, 2019

Hi,

           Given the GDP changes that are coming for cloud (https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) we are trying to get all the users added in JIRA using  without username, query parameters.

Shall we call the API just like https://<our cloud instance>/rest/api/2/user/search?query=startAt=1&maxResults=1000 . This will return the first 1000 users? if you provide any suggestion will help us to move the GDPR changes in the future.

 

Thanks,

Anand

3 answers

1 accepted

1 vote
Answer accepted
Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

Hi

I think your call has an issue - it should be

/rest/api/2/user/search?startAt=0&maxResults=1000

You can also add two further parameters - the first will return all users, the second allows you to get inactive users as well

&username=%
&includeInactive=true
Anand Elumalai February 19, 2019

Thank you so much @Warren , so i can use /rest/api/2/user/search?startAt=0&maxResults=1000 this api to get users without username parameter after GDPR date(March-29-2019)?

if i use username parameter in the API mean it will be accepted after GDPR date? 

 

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2019

Hi @Anand Elumalai 

No, I think you need to be careful here.

After the GDPR date, the username will NOT be returned via this call, you will only get the accountId. You will also not be able to query for a specific user by passing in their username as a parameter.

What I've offered as my original answer, using parameter &username=% is more for running now to get a list of all users, which will return their username because the GDPR changes haven't started

0 votes
Anand Elumalai February 26, 2019

Contacted JIRA support and they suggested to use below API post GDPR date.

rest/api/3/user/search?query=%  - to filter all users.

Lukas Krajnak
Contributor
June 24, 2019

I tried to use "rest/api/3/user/search?query=%", but it doesn't work, username=% worked until yesterday and now it only returns blank table :( Any other suggestions? 

 

Thanks, 

 

Lukas

Warren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 24, 2019

Hi @Lukas Krajnak 

So 1 minute after reading this, I came across a post from the Atlassian Developers Community which gave me a working solution, try :

/rest/api/3/user/search?query=

with no parameters passed in - it works for me.

The post is here

Like # people like this
Lukas Krajnak
Contributor
June 24, 2019

Seems like paremeter  includeInactive  is not working anymore, so there is no way to get list of all inactive users anymore. Is there any other workaround?

Like Rol likes this
Aleksandr Gilmanov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2019

Also works

/rest/api/3/user/search?query=+
I don't know why. And why there is no docs about it.
Like # people like this
0 votes
Anand Elumalai February 20, 2019

/rest/api/2/user/search?startAt=0&maxResults=1000&username=%)  instead of %, _ is working 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events