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

Kristjan Vilipõld September 18, 2019

Hi Atlassian fellas,

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

These all work well:






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

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