Not able to get the name and emailAddress using USER REST API - get method

Shiva Reddy Gadiga December 21, 2021


We are trying to get the name and emailaddress on USER REST API based on email Address as search params


API -> https://api.atlassian.com/ex/jira/xxxxx-xxxx-xxxx-xxxx-xxxx/rest/api/3/user/search

I am getting only the following object in the response:


self
accountId
accountType
avatarUrls
displayName
active
timeZone
locale

I don't see the name and also emailaddress as blank in the above response.

How to get the name and emailaddress with the USER REST API with search params for emailAddress or null

 

Also i have another API -> https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-users-search-get

where in documentation the response is shown as

{
"self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
"key": "",
"accountId": "5b10a2844c20165700ede21g",
"accountType": "atlassian",
"name": "",
"avatarUrls": {
"48x48": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48",
"24x24": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
"16x16": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
"32x32": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32"
},
"displayName": "Mia Krystof",
"active": false
},


But when we tried to implement, we are not able to see the name and emailAddress.


Kindly help me to get the name and emailAddress using REST API on search condition based on emailAddress.


Regards,
Shiva

1 answer

1 accepted

0 votes
Answer accepted
David Bakkers
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.
December 22, 2021

Google "Jira REST API v3 get user email address"

Shiva Reddy Gadiga December 23, 2021

Hey David,

Thank you. i have tried everything, but no luck.
I need to get name based on the search condition on emailaddress.

Also by default i should see the emailaddress when I hit USER API.

 

Thanks
Shiva.

David Bakkers
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.
December 23, 2021

If you read the articles, you will see hundreds of times where the same answer has been given to the same question.

You can only search based on a user's username or email address, but you will never receive a user's username back from Jira Cloud via the User search endpoints, since that ability was removed from the product in 2019.

As per the documentation:

name

string. This property is no longer available and will be removed from the documentation soon. See the deprecation notice for details.

You will only ever get the user's email address back if it is permitted, as per the documentation:

emailAddress

string. The email address of the user. Depending on the user’s privacy setting, this may be returned as null.

The only endpoint that will transmit email addresses on request is Get user email, but it too is restricted, as per the documentation:

Returns a user's email address. This API is only available to apps approved by Atlassian, according to these guidelines

Connect app scope requiredACCESS_EMAIL_ADDRESSES

Lastly, you asked the same question in this thread and also this one all on the same day!

To triple post the same question across three different sections of the community site is very poor form.

Suggest an answer

Log in or Sign up to answer