Forums

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

Scriptrunner user getEmail returns null

i_gavirlita
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2026

Hello there!

We are currently in the process of migrating to Jira Cloud and reworking old DC scripts to work on Cloud.

One issue we have found is the inability to get a users email address programmatically via script console or listeners.

For example the following code snippet returns data about the reporter, but the email address attribute is null no matter if I run it as logged in user or scriptrunner add on user

 

def issue = Issues.getByKey('PG-547') 
[issue.reporter]


// returns
[
{
"entityProperties": {
"keys": [
"ai-streaming-spotlight",
"attachment-spotlight-seen",
"card-cover-spotlight-seen",
"com.atlassian.jira.frontend.VisualRefreshIconCacheBuster:clear-cache-state-v2",
"help_button_ui_state",
"jira.home.last-visited-tab",
"jsw-onboarding-checklist.open",
"jsw-onboarding-checklist.open-task",
"jsw-onboarding-checklist.visibility",
"jwm.overviews.plan.import.state",
"navigation_next_ui_state",
"standard-roadmap.board-34",
"standard-roadmap-macro.board-34"
]
},
"accountId": "removed",
"accountType": "atlassian",
"active": true,
"applicationRoles": null,
"avatarUrls": {
"16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-2.png",
"24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-2.png",
"32x32": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-2.png",
"48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/D-2.png"
},
"displayName": "Dmytro",
"emailAddress": null,
"expand": null,
"groups": null,
"key": null,
"locale": null,
"name": null,
"self": "https://autodoc-eu.atlassian.net/rest/api/2/user?accountId=removed",
"timeZone": "Europe/Berlin"
}


After doing some investigation we found out that it could be because of the user profile settings email is set to the organization only  instead of public (in case of public the email is found and works ok). But all our users are already managed in the organization  by default and scriptrunner is also installed here so it should work even though users' email is not set to public

I have tried to add the scriptrunner app in the admin panel to have access to the organization data and from the described permissions it says on the last line that the app should indeed have access to user profile data including the email.

 

So the question is - is there some additional configuration that needs to be done or are we doing something wrong in order to get the user email from the reporter/assignee/user picker fields? Or is there some additional setting that can help bypass there gdpr restrictions ?
This functionality is critical for us because we have a lot of integrations using the emails? especially the issue.reporter.email syntax because as you can see it is not working currently

I have also found the dev /rest/api/3/user/email API that seems to work no matter the privacy settings set, so why does scriptrunner not have this built in?

The API scope and permissions seem to match those set in the scriptrunner app from the admin panel as far as I can tell


Do I have to use a helper function to get the emails instead from now on?
How do others deal with this use case?

 

Thanks!

 

 

1 answer

0 votes
Philipp Sendek _catworkx_
Community Champion
May 26, 2026

Hi @i_gavirlita ,

as this is a question related to Script Runner and you're paying for the license, the best way for me personally is always to create a support ticket. They are surely glad to help you.

You can create a support request with them here: https://the-adaptavist-group-support.atlassian.net/servicedesk/customer/user/login?destination=portals

To still give your question visibility, let me mention a few people from Adaptavist who will be able to point you in the right direction. :-) 

FYI @Astrid Sieben  @Phill Fox @Kristian Walker _Adaptavist_ 

Greetings
Philipp

Suggest an answer

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

Atlassian Community Events