Came across this post but have not found an answer.. https://community.atlassian.com/forums/Jira-questions/How-to-receive-e-mail-address-of-user-with-scriptrunner/qaq-p/1602127#U3240342
I am trying to receive the email address of the reporter so I can look them up in another application however I keep running into errors in script runner telling me I cannot access the email address of the reporter
Check if the user email its hidden. In the profile setting you can set it that way.
Test it with your account. Set it to only you and admin.
https://support.atlassian.com/confluence-cloud/docs/configure-user-email-visibility/
Thats the only reason i know you cant get the user email.
Regards
thanks i ended up using jira automation to put the email address into a custom field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My first question would be: Does the user whose email address you want to display belong to the same company that uses the Jira Cloud domain? If yes, using ScriptRunner for Jira Cloud's HAPI feature, you can do this, for example:
def currentUser = Users.loggedInUser
logger.warn "${currentUser.emailAddress}"
However, if the user does not belong to the same company, for example, if it is an external user that has been granted temporary access, then the only way to get ScriptRunner to display the email address with the code above is if the user whose email address you want to see grants the visibility to Anyone, as shown in the screenshot below:-
For this, the user whose email address is to be displayed needs to go to this URL: https://id.atlassian.com/manager-profile/profile-and-visibility and set the Contact visibility to Anyone.
I hope this helps to answer your question. :)
Looking forward to your feedback.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.