Information Technology Reference
In-Depth Information
How it works…
JIRA's e-mail templates use the Apache Velocity ( http://velocity.apache.org ) template lan-
guage to display dynamic data. Each template is a mix of static text (with or without
HTML markups) and some Velocity code. If you do not need to have dynamic contents,
then you can have only static text in your templates.
In our previous examples, every time you see the dollar sign ($), such as $issue.key , it
is a piece of Velocity code. The $ sign indicates getting a variable from the Velocity con-
text, and the variable name is the word that comes directly after the $ sign; so, in this case,
it is issue . The period ( . ) means getting the value specified from the variable. So, $is-
sue.key can be read as "get the value of key from the variable issue", or in other words,
"get me the issue's key".
JIRA exposes a number of variables in its Velocity context for e-mail templates; you can
find the full list at https://confluence.atlassian.com/display/JIRA041/Velocity+Context+-
for+Email+Templates .
So, if we take a look at our templates, for the subject template, the ($issue.key)
$issue.summary Velocity code will be turned into something like (TP-12)
Request for JIRA administrator access , where TP-12 replaces $is-
sue.key and Request for JIRA administrator access replaces $is-
sue.summary .
The following screenshot shows a sample e-mail from the custom template we have cre-
ated:
Search WWH ::




Custom Search