Forums

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

How can I get user email from Jira API?

Андрей Киселев July 7, 2024

Hi evreone.

im using doc. for API - https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-rest-api-2-user-get

if i try to get value  'emailAddress' with request,

i get an error - KeyError: 'emailAddress'

but if i try to get value  'active or displayname or any' with it 

i get correctly response

 

 

response = requests.request("GET", f'{url}/rest/api/2/users', headers=headers, auth=auth)

 

print(response.json()[0]['active']) #get True/False - it's ok

print(response.json()[0]['displayName'])#get username - it's ok

print(response.json()[0]['emailAddress']) #but! get KeyError: 'emailAddress'

 

maybe me make mistake ?

2 answers

1 accepted

0 votes
Answer accepted
Андрей Киселев July 7, 2024

ok. its  bag =)

0 votes
Victor Law
Community Champion
July 7, 2024

Hi @Andrei Kiselev

I suggest checking if the user account has a privacy setting that restricts it from being shared with the public, which might affect whether the email address can be retrieved.

https://confluence.atlassian.com/cloudkb/profile-visibility-defaults-for-atlassian-accounts-1116292287.html

Thank you.

Андрей Киселев July 7, 2024

no, everything is very easy =) 

my mistake was that I was trying to get email addresses for an account in the app

Like # people like this
Андрей Киселев July 7, 2024

but, as it turned out, apps don't have email address =)

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer