Email Templates


The Email Templates screen allow you to create custom Email templates that are then used by one or more Mail Queues.



Velocity

Click on the question mark below the edit field for a list of standard velocity variable defined in the velocity context

Subject

The subject has the additional velocity variables defined:

VariableDescription
queueThe name of the queue
counterThe email counter number
dateThe date of the email formatted as a string
subjectsA list of subjects as used in the email body
subjectCountThe number of subjects in the email
firstSubject

The first subject that will appear in the email. This is an object, so use methods to access, eg $firstSubject.getSubject()

getOrder()
getIssueKey()
getEventTypeId()
getSubject()
getAuthor()
getAuthorUrl()
getAvatarUrl()
getChangeDate()
getIssueTypeIconUrl()
getIssueTypeIconUrlDesc)(
getPiorityIconUrl()
getPriorityIconUrlDesc()

Generic Context

The Velocity Context expanded in 1.3.7 to include a literal copy from the JEMH Project, enabling many core JIRA services to be available, enabling lookup by issue key etc. At this time there is no dynamic inspection and linking to the API, this will be merged over at a later time.

KeyType
urlbaseurl
stringUtilsorg.apache.commons.lang.StringUtils
padSize20
i18n com.atlassian.jira.util.I18nHelper, applicable to recipient user
userManagercom.atlassian.jira.user.util.UserManager
groupManagercom.atlassian.jira.security.groups.GroupManager
watcherManagercom.atlassian.jira.issue.watchers.WatcherManager
issueManagercom.atlassian.jira.issue.IssueManager
wikiRenderercom.atlassian.jira.issue.fields.renderer.JiraRendererPlugin
dateFormatterSimpleDateFormatter of type DateTimeStyle.DATE_TIME_PICKER



Subject Example

This snippet uses the sorted list of uniqueIssueKeys in the digest, looks them up, and outputs the reporter user (ApplicationIUser type) Name

#foreach ($aKey in $uniqueKeyList)
 $aKey (reporter: $issueManager.getIssueObject($aKey).getReporter().getName()
#end

Body Example

Example showing arbitrary issue retrieval

<h1>-- EMQ-2 reporter is $issueManager.getIssueObject("EMQ-2").getReporter().getName() -- </h1>