Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Scriptrunner post-function custom email template - how to add custom fields?

Kristjan Vilipõld
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!
September 18, 2019

Hi Atlassian fellas,

How can I add custom field value to the scriptrunners custom email template?

These all work well:

$issue.summary

$issue.issueType.name

$issue.reporter.displayName

$issue.description

 

But how to get the custom field values?

1 answer

5 votes
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2019 edited

Hello @Kristjan Vilipõld

Thank you for reaching out.

To add custom field values to your Email template in a Scriptrunner Post Function, you can check the example added in the Send a custom email section of the documentation below:

Scriptrunner Post-functions - Send a custom email

Basically, this would be the reference code:

Custom field value: <% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("MySelect")) %>

Let me know if this information helps.

Mayank Kamra February 28, 2024

Amazing @jpett works like a charm for me!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events