Is there a list of available "variables" for the Email templates in script runner listeners?


we would like to send out custom emails, where the body of said email differs depending on the event (update, creation, commented) and where we can see the changes (in case of an updated ticket)

Unfortunately I seem to not be able to find any listing of possible variables to use in the Template.

Can anyone point me to the right direction on where to find (or generate) all possible variables?


1 answer

0 vote

There is not much more than what you can see in the example mail here:

"issue" should have most of what most people need.

There are a few variables for comments, but that's explained in the doc.

Is there a way to print changes or which event triggered the listener? At the moment I distinguish by "lastComment", but this will not work on a changed Ticket: {code} <% if (lastComment) { out << "The " << <<" https://jira/browse/"<<; issue.key << " with priority " << issue.priority?.name << " has been updated:\n" out << "Last comment: " << lastComment } else { out << "New " << <<" https://jira/browse/"; << issue.key << " with priority " << issue.priority?.name <<":\n" out << "-----------------------------------------------------\n" out << issue.description } %> {code}

Hi @Tobias Vollmer Were you able to get changes or events which triggered the listener? I am sending email for almost all events and would like to differentiate in the email body if possible. Any help would be appreciated!! Thanks

Hi @Bhupesh Nagda, unfortunately I was not able to get the changes. To the event triggered can be accessed with "event.eventTypeId". Please be aware that the use of this Variable will cause the Preview to throw an exception (as no event is triggered). We used the Eventtype in a switch statement: <% switch (event.eventTypeId) { case "1": //Created out << "has been created." break case "2": //Updated out << "has been updated." break case "5": //Closed out << "has been closed." break case "6": //Commented out << "has a new comment." break case "7": //Reopened out << "has been Reopened." break default: //Unknown out << "has triggered the event: " << event.eventTypeId } %> Cheers, Tobias

Thanks for the reply

The website is broken and there is no event object.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

610 views 3 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you