Get emailAddress of user with REST API

Andrew Culver
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 2, 2018

I'm using the REST API to get the user object from an instance running Jira 7.7.0. I'm using my own credential (full administrator permissions) and searching for myself:

https://jiradev.uwo.ca/rest/api/2/user?username=aculver

This returns:

{"self":"https://jiradev.uwo.ca/rest/api/2/user?username=aculver","key":"aculver","name":"aculver","avatarUrls":{"48x48":"https://jiradev.uwo.ca/secure/useravatar?ownerId=aculver&avatarId=10830","24x24":"https://jiradev.uwo.ca/secure/useravatar?size=small&ownerId=aculver&avatarId=10830","16x16":"https://jiradev.uwo.ca/secure/useravatar?size=xsmall&ownerId=aculver&avatarId=10830","32x32":"https://jiradev.uwo.ca/secure/useravatar?size=medium&ownerId=aculver&avatarId=10830"},"displayName":"Andrew Culver","active":true,"timeZone":"America/Toronto","locale":"en_CA","groups":{"size":7,"items":[]},"applicationRoles":{"size":1,"items":[]},"expand":"groups,applicationRoles"}

No emailAddress attribute, which should be there according to the REST API docs: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-user-get 

I've run the same REST call against two older instances running 6.3.13 and 7.3.6. Both return the emailAddress attribute.

How do I get the email address of a user with the REST API in 7.7.0?

I just posted this 10 minutes ago and it was marked as spam and removed from the list of questions. This isn't spam! :|

2 answers

1 accepted

1 vote
Answer accepted
Andrew Culver
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 5, 2018

The global setting User email visibility was set to hidden in the 7.7.0 instance. Even though I was using the API as a system administrator user, and that user is able to view email addresses in the GUI, they remain hidden in the API unless that setting is changed.

Changing that setting allowed the emailAddress attribute to appear in the API.

I've asked Atlassian if this is working as intended or not.

Vyshnavi Bandarupalli July 18, 2019

I changed the user email visibility to public but still could not see the email details of the users

I am using rest api rest/api/2/user/assignable/search?project

Can you please help

1 vote
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2018

Dear @Andrew Culver,

what I first noticed, that the upper link points to a cloud api doc - cloud an server react differently.

But, if your result is not looking like the example of GET /rest/api/2/user, then I think you have discovered a bug.

So long

Thomas

Andrew Culver
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 5, 2018

Thanks. I did look at the latest server API doc as well, after posting.

I have opened a support case with Atlassian.

Suggest an answer

Log in or Sign up to answer