Forums

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

Body Email with Scriptrunner in Jira Data Center

Luis Angel Valencia August 2, 2024

Hi Community, 

 

 

Currently I´m using this  line in my body mail to set the "custom_field" value <% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("MyFieldName")) %> 

I want to set another custom field but in this case of "User Picker" type.

 

Do you know how can I set it?

 

Regards.

2 answers

0 votes
Tomasz Kowalczyk
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.
August 5, 2024

You can do the same but on the end try do get Display Name of user.
So you can achieve this by this line of code
<% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("MyFieldName"))?.getDisplayName() %> 

it will work on single user picker. If you have multiple values in this picker then it will be a little bit more complicated. 

0 votes
Bhanu
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.
August 2, 2024

Hi @Luis Angel Valencia

Welcome to the community!

Please share some details on what module you are using from script runner to get some insight into what you are trying to achieve?

 

Suggest an answer

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

Atlassian Community Events