List of variables for custom email?

MathewI September 26, 2012

Hi there- I've been searching quite a bit, and I can't seem to find any kind of reference as to what the possible variables are in a custom email.

I'm just looking to find one to insert the name of the current assignee. Can anyone point me in the right direction? Preferably to a good reference for this kind of thing, but a quick answer is awesome too :)

2 answers

1 accepted

3 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
September 26, 2012

See https://developer.atlassian.com/display/JIRADEV/Velocity+Context+for+Email+Templates

$issue.assignee.displayName ($issue.assignee.fullName in old JIRA I guess) will get you the current assignee in email.

MathewI September 26, 2012

I'll try this out when I get back to my desk. Thanks!

I'm not quite sure how to interpret the info in the link you gave me, though. I'm more of a sysop than a developer, and I've inherited this jira instance... if I were looking for that variable (if that's the right term), how could I have discerned that $issue.assignee.displayName was the right one?

Just trying to learn, so I don't have to ask similar questions in the future :)

Thanks!

Jobin Kuruvilla [Adaptavist]
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.
September 26, 2012

Once you know there is an object avaialbel (like issue in this case), you can use the Java APIs to get the rest of the info from it.

$issue.assignee.displayName translates to issue.getAssignee().getDisplayName()

MathewI September 26, 2012
Thanks again! Case sensitive?
JamieA
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.
September 26, 2012

Yes it is case-sensitive.

0 votes
JamieA
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.
September 26, 2012

You're question had the script runner tag so I'm assuming you are doing a custom email via that plugin, ie https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail

What's available is broadly https://studio.plugins.atlassian.com/wiki/display/GRV/Built-In+Scripts#Built-InScripts-TechnicalStuffforAdvancedUsers but I think it happened to intersect with what you needed that you got from Jobin's answer, ie issue.

> if I were looking for that variable (if that's the right term), how could I have discerned that $issue.assignee.displayName was the right one?

Only through familiarity or reading the javadoc.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events