How to code Custom Field contents in a scriptRunner post function email body.

Jeff Peters October 7, 2016

I am trying to add two custom field values into the body of my email. One field is a single line text field 'Custom Field A' and the other is a user picker field 'Custom Field B'.

How do you do this? For 'Custom Field B' I need the displayName to be in the email instead of the UserID.

Many thanks for your timely assistance.

1 answer

1 vote
adammarkham
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.
October 20, 2016

The templates should be:

Text Field value: <% out <<
	issue.getCustomFieldValue(
    	com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("TextField")
    ) %>

Single User picker value value: <% out <<
	issue.getCustomFieldValue(
    	com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("UserPicker")
    )?.displayName %>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events