Forums

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

/user/search endpoint only returns active users

Nitin Patel
Contributor
April 21, 2020

The find users endpoint - https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-user-search-get, only returns the list of active users. Do I need to pass a parameter so that it returns disabled users too? 

2 answers

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2020

Hello @Nitin Patel ,

I'd just like to inform that JRACLOUD-74331 has been fixed.

I am now marking this thread as resolved.

 

Cheers,
Dario

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 22, 2020

Hello @Nitin Patel ,

I you want to also get the inactive users, you should call the endpoint to Get all users instead:

Get all users

GET /rest/api/3/users/search

Returns a list of all (active and inactive) users.

 

Please test this and let me know if it works as expected.

 

Cheers,
Dario

Nitin Patel
Contributor
April 22, 2020

Hi @Dario B

 

this endpoint does not return the `emailAddress` field while the /user/search API does. Is there a way to have both the things? We want to fetch all users (active and inactive) along with their emailAddresses. 

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2020

Hi @Nitin Patel ,

This could actually be related to the changes to our products and APIs to improve user privacy in accordance with the European General Data Protection Regulation (GDPR). For details please see:

 

As mentioned in above page, the email address will be returned or not depending on the user's Profile Visibility Settings (for the most of the REST API user related endpoints) and it can be the case that either this is still under development or they decided not to include the email address for the Get all users endpoint. 

I am currently discussing this behavior with DEV I will update this thread in the next days.

 

Cheers,
Dario

Nitin Patel
Contributor
April 23, 2020

Thank you. Please let me know. 

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2020

Hello @Nitin Patel ,

I have created the below bug ticket to either have a consistent behavior among the user related REST API endpoints or have explicitly documented why the ones to get all users are not returning the emailAddress field:

Please vote for the above bug ticket and set yourself as a watcher so that you will be notified in case of any update/progress. The bug will be addressed according to the Atlassian Cloud bug fixing policy.

 

In the meanwhile, as a workaround, you can use the one I added to the bug ticket:

Workaround

If you want to get the list of all the users, active and inactive for your instance including the email address you can use the Export Users button on the top left of the User Management page for your site:

 

This way you can configure what will be included and what not and you will get in return a CSV file including email address, account ID and other useful data that can be easily parsed. 

 

I hope this helps.

 

Cheers,
Dario

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 6, 2020

To add more details:

This bug is affected by the email visibility setting on your instance:

  • Jira Settings > System > General Configuration > User email visibility

If this is set to "Show to logged in users only" (which is the default), then this endpoint does not return the email addresses at all (that's a bug, visible email addresses should be returned)

However, if you change this setting to "public", then email addresses are returned, but if the person's email visibility is set to "public" then this would cause their email address to be returned even for anonymous requests, which may not be desirable.

Nitin Patel
Contributor
May 6, 2020

Hey, 

The workaround won't help us as we manage our customers' jira account via API tokens only and we don't have access to their jira account. 

Is there a timeline on when this bug will be fixed? It is important to us and currently, we're not able to do that. 

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2020

Hello @Nitin Patel , 

There is no ETA for this bug yet.

As already written the only 2 possible ways to proceed at the moment are to ask the site-admin of the Jira instance to either:

  1. Provide the CSV with the list of the active and inactive users (including email addresses and AccountIDs)
  2. Change the User email visibility setting to "public" so that email addresses will be returned also when calling the Get all users endpoint (but please be aware that the email addresses will also be returned for anonymous rest api calls).

Please follow the bug ticket for updates.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events