How to receive e-mail address of user with scriptrunner

Robin Weiß February 4, 2021

Hi,

How can I receive the e-mail address of an user with scriptrunner?
With Postman it is no problem to see the e-mail address of an user. But with scriptrunner it seams to restrict the access to the e-mail addresses. I tried the script with my user (org and site Admin) and the scriptrunner user. 

Thanks

2 answers

1 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
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 4, 2021

Hi Robin,

Thank you for your question.

I can confirm that unfortunately, that the Get User Email API which Atlassian provides is an experimental API, which currently is not supported by ScriptRunner for Jira Cloud as currently, we do not support these experimental API's as these change how they work or become deprecated and we are not currently supporting have the App whitelisted to be able to access all users email addresses.

However, I can confirm you can get a users email address by calling the Get User Rest API  as this will return a users email address if they have chosen not to hide it in their privacy settings.

It is worth noting that a users email address may be hidden as Atlassian added in the option for users to hide their email address in the GDPR changes they made in 2019 as described here and if a user chooses to hide this then it will not be possible for ScriptRunner for Jira Cloud to return this as we cannot override the GDPR Settings controlled by Atlassian.

I hope this information helps.

Regards,

Kristian

Robin Weiß February 4, 2021

Hi Kristian Walker,

thank you for the detailed information.

Regards
Robin

0 votes
David Harkins
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.
May 15, 2023

Add the User to an Object Variable (e.g. User) then call:

user.getEmailAddress()

Came across this while working on something similar. 

Suggest an answer

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

Atlassian Community Events