/user/search API does not return emailAddress field

Nitin Patel March 2, 2020

Hi, 

 

One of our customers - Next Insurance, has integrated with us and we're trying to fetch all users in their Jira. 

We use this endpoint https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-users-search-get to fetch the users, but for this customer, the emailAddress field is coming up as an empty string.  

Can you help me find out why that might be happening? 

Here's the curl request: 

curl --location --request GET 'nextinsurance.atlassian.net/rest/api/3/user/search?username=&maxResults=1000' \
--header 'Authorization: <redacted>'

 

3 answers

2 votes
Frederick Claudino October 13, 2022

I have the same issue here. Also the option for Admins does not work. I am administrator from my instance and the emails are not shown.

@Angélica Luz Do we have a solution for this issue?

I need to extra the users information to comply with audit and makes no sense to do this by hand.

 

thanks in advance!!

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 27, 2021

Hello @Jagadeesh Kumar,

Thank you for reaching out to the Atlassian Community!

The behavior you are experiencing is expected.

If the user selects the option “Only you and admins”, it’s expected that the API won’t return their email address, even if it’s an administrator using the API, but as an administrator, you will be able to view their email address via user management on the UI.

There is a feature request suggesting improvements for that:

Please, click on vote and also watch the ticket above to receive updates from our product managers.

Kind regards,
Angélica

Егоров Виктор November 7, 2022

That's why I hate Atlassian. The "behavior you are experiencing is expected", but it is not expected by your customers.

It is really unexpected behavior! It brakes my current integration. I have to ask all my Jira users to change their settings and share their email to everyone to fix this problem.

Like # people like this
Filippo
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!
March 30, 2023

and btw, I am experiencing this even if the user did not select: “Only you and admins”. The API return 

"emailAddress":"",

seems a bug to me

Florent Clairambault
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!
April 30, 2024

This issue has been reported in 2019 without any activity.

Atlassian products get more complicated and harder to integrate every year.

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2020

Hello Nitin,

Thank you for reaching out to Atlassian Community!

Since the Atlassian account was introduced some years ago, administrators can't manage users' accounts anymore. 

With that said, users can choose if they want to let their profile picture, full name, email address and other information as public or private.

I tested the API using my local site and if the user set the email as private (only you and admins), it won't show when using the API, that's why the emailAddress show empty.

To fix this, the user must go to https://id.atlassian.com/manage-profile/profile-and-visibility and set the email visibility to Anyone.

Screen Shot 2020-03-06 at 15.08.54.png

Regards,
Angélica

Jagadeesh Kumar December 22, 2021

Hello @Angélica Luz 

We are facing the same issue at our end. API returns email address in the response when visibility is set to 'Anyone'.

However, when set to 'Only you and admins', despite fetching user information via REST API using admin credentials, email address is missed out in the response & it is misleading.

Appreciate your valuable thoughts / suggestions. Thank you.

Suggest an answer

Log in or Sign up to answer