Jira Email Templates - Features

After successful installation, you can find the app under System.

There are two tabs:

  • Jira Email Templates: System created templates

  • My Email Templates: Your user created templates

  • Below are the features of the Jira Email Templates

Jira Email Templates

  • Click Jira Email Templates: and all the Jira templates available in your system are listed on left side bar.

  • To Edit:

    • Click on your selected template

    • Modify its content

    • Click Save after you’re happy with your changes

    • Restart Jira to apply new changes

Jira Email Templates - Context

This page lists and describes objects available when rendering an email template.

Workflow transition context

Since the email template is rendered during execution of a workflow post-function it has access to values set in this transition. If the workflow transition has a screen it will also see the values set in the form and comment added to the transition.

Context objects

  • ${issue} - [com.atlassian.jira.issue.IssueImpl] Issue object

  • ${description} - [String] Formatted issue description - wiki format already rendered to HTML

  • ${proj} - [com.atlassian.jira.project.ProjectImpl] Project object

  • ${project} - [org.ofbiz.core.entity.GenericValue] Project entity

  • ${pkey} - [String] Project Key

  • ${baseurl} - [String] Base URL of the application (ex. http://localhost:2990/jira)

  • ${userKey} - [String] Current user (user who triggered the transition)

  • ${comment} - [String] Comment submitted in the view

  • ${commentLevel} - [String] Comment submitted in the view

  • ${roleLevel} - [String] Comment submitted in the view

  • ${actionId} - [Integer] The transition ID number

  • ${cfUtils} - [lv.itidea.jira.plugins.workflow.pf.email.CustomFieldHelper] Plugin's utility class to help fetching the issue's customfield values

  • ${i18n} - [com.atlassian.jira.web.bean.I18nBean] Bean for accessing the message translations

  • ${currentMillis} - [java.lang.Long] current time in milliseconds

  • ${stringUtils} - [org.apache.commons.lang.StringUtils] Apache Commons utility class

  • ${dateTimes} - [com.atlassian.jira.datetime.DateTimeVelocityUtils] Provides methods for parsing Date

  • ${dates} - [com.atlassian.jira.datetime.DateVelocityUtils] Provides methods for parsing Date

  • ${dateFormatter} - [com.atlassian.jira.datetime.DateTimeFormatter] JIRA date time formatter class

  • ${dateTimeStyle} - [com.atlassian.jira.datetime.DateTimeStyle] JIRA Date Time Style enum

  • ${jirautils} - [com.atlassian.jira.util.JiraUtils] JIRA utility class

  • ${jirakeyutils} - [com.atlassian.jira.util.JiraKeyUtils] JIRA utility class

  • ${userutils} - [com.atlassian.jira.user.UserUtils] Bean for retrieving users

  • ${jiraUserUtils} - [com.atlassian.jira.user.util.UserUtil] Bean for retrieving users and groups

  • ${avatarService} - [com.atlassian.jira.avatar.AvatarService] JIRA Avatar service

  • ${externalLinkUtil} - [com.atlassian.jira.web.util.ExternalLinkUtil] JIRA external link utility class

  • ${cfValueEncoder} - [com.atlassian.jira.render.SwitchingEncoder] JIRA customfield value HTML encoder class

  • ${projectManager} - [com.atlassian.jira.project.ProjectManager] JIRA project manager

  • ${customFieldManager} - [com.atlassian.jira.issue.CustomFieldManager] JIRA custom field manager

  • ${constantsManager} - [com.atlassian.jira.config.ConstantsManager] JIRA constants manager

  • ${issueConstantWebComponent} - [com.atlassian.jira.web.component.IssueConstantWebComponent] JIRA constants image rendering class

  • ${velocityhelper} - [com.atlassian.jira.util.JiraVelocityHelper] JIRA Velocity helper class

  • ${urlcodec} - [com.atlassian.jira.util.JiraUrlCodec] JIRA URL query params encoding helper class

  • ${urlModeAbsolute} - [com.atlassian.plugin.webresource.UrlMode] Instance of UrlMode.ABSOLUTE enum

  • ${webResourceUrlProvider} - [com.atlassian.plugin.webresource.WebResourceUrlProvider] JIRA utility for formatting URLs

  • ${build} - [com.atlassian.jira.util.BuildUtilsInfo] JIRA build information class

  • ${textutils} - [com.opensymphony.util.TextUtils] Text utility class

  • ${xmlutils} - [com.atlassian.core.util.XMLUtils] XML utility class

Use of Context Objects

Listed above objects can be referenced in the template using Velocity expressions.

Accessing issue fields

  • ${issue.summary}

  • ${description} - Rendered version of ${issue.description} field

  • ${issue.description}

  • ${issue.assigneeId}

  • ${issue.assignee.displayName}

  • ${issue.reporterId}

  • ${issue.reporter.emailAddress}

  • ${issue.priority}

  • ${issue.priorityObject}

  • ${issue.created}

  • ${issue.updated}

  • ${issue.dueDate}

  • ${issue.resolutionDate}

  • ${issue.status}

  • ${issue.statusObject}

Accessing issue customfields

  • $!{cfUtils.getValue($issue, "customfield_10000")} - Retrieving string representation of customfield value or null

  • $!{cfUtils.getRenderedValue($issue, "customfield_10000")} - Retrieving rendered value of customfield or null

  • $!{cfUtils.getVal($issue, "customfield_10000")} - Retrieving actual value object of customfield value or null

Accessing Checkbox and Multiselect list values (value of type java.util.ArrayList)

  • $!{cfUtils.getVal($issue, "customfield_10000").get(0)} - Retrieving first selected option of checkbox or multiselectlist customfield (might be null!)

Accessing Radiobutton and Select list values (value of type com.atlassian.jira.issue.customfields.option.Option)

  • $!{cfUtils.getVal($issue, "customfield_10000").getValue()} - Retrieving selected option name of radiobutton or (single) select list customfield (might be null!)

Accessing Cascading select list values (value of type java.util.HashMap)

  • $!{cfUtils.getVal($issue, "customfield_10000").get(null)} - Retrieving selected 1st level option of cascading select list customfield (might be null!)

  • $!{cfUtils.getVal($issue, "customfield_10000").get("1")} - Retrieving selected 2nd level option of cascading select list customfield (might be null!)

Accessing current user username

  • ${userKey}

Accessing comment provided with transition

  • ${comment}