Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Email templates define the content and layout of the emails that may be sent using Email This Issue. 

...

VariableDescriptionExampleType
currentUserThe current user object who's sending the email

$!currentUser.displayName

Renders the full name of the current user

User
mailSubjectEmail subject entered manually in the Subject field in the manual email screen, notifications or workflow post functions.
String
mailBody

Email body entered manually in the Body field in the manual email screen, notifications or workflow post functions.


Add this variable to all templates where you want to render email body entered by the users.


String
issueThe Issue object with all available fields. The email is being sent in relation to this issue.

$!issue.summary

Renders the issue summary in the template

Issue
baseUrlBase URL of the Jira Cloud site. Useful to add links to Jira screens or operations.

It is a simple String value you can use in building links.

String
issueEventIssue event object if the email is being sent as an event notification
IssueEvent
commentThe comment the user enters during the operation. E.g. when editing an issue or executing a workflow transition.

#renderComment()

Renders the comment

Comment
changeLogChangelog object holding information about all fields changed during the operation. Old and new values are available.

#renderChanges()

Renders the changelog in a readable structure

Changelog
worklogWorklog object holding details of the worklog entered or edited.

#renderWorklog()

Renders the worklog details

Worklog
emailCommandEmail definition object holding all recipients, subject and body, issue event and comment details.

$!emailCommand.attachments

Returns the list of attachments being added to the email

EmailCommand
sentDate

A formatted date representing when the original email was processed by Email This Issue.

Available only in Reply/Reply all/Forward for an email.

$!sentDate

Prints the when the email was processed by Email This Issue

String
stringUtilsString helper methods

$!stringUtils.isBlank($!issue.summary)

returns true if the issue summary is empty or null

$!stringUtils.join($!issue.labels, ", ")

prints the labels separated by comma

org.apache.commons.lang3.StringUtils
templateSupportSupport object useful in templates. Constantly enhanced object, it will receive more and more methods.
TemplateSupport

...

Macro signatureParametersDescriptionExample
#renderDateTime($dateTimeValue $pattern $timezone)
  • $dateTimeValue: the value to be formatted
  • $pattern: the pattern describing the date and time format. You can find description about formatting and patterns here
  • $timezone: the time zone used for formatting. You can find a list of in the Supported Time Zones Appendix
Formats a dateTime field based on the pattern and the timezone.

#renderDateTime($!issue.created "dd MMM yyyy hh:mm a" "Australia/West")

#renderIssueComments($order $num $restrictions)
  • $order: "asc" or "desc"
  • $num: an positive integer number or "all" to render all comments matching <restrictions>
  •  $restrictions: comment restrictions, values are
    • empty: render all comments regardless of the restrictions
    • "none": render comments which are not limited to groups, roles or which are not internal in Service DeskService Management
    • "public": render Service Desk Management public comments
    • "internal": render Service Desk Management internal comments

Generic, multi-purpose comment rendering macro.

#renderIssueComments("desc" "all" "")
prints all comments starting with the latest one
#renderIssueComments("asc" "all" "")
prints all comments starting with the first one
#renderIssueComments("desc" "1" "")
prints the latest comment
#renderIssueComments("desc" "all" "none")
prints all comments which are not restricted
#renderIssueComments("desc" "all" "public")
prints all public comments starting with the latest one
#renderLinkToPortal($linkText)
  • $linkText: text to show for the link in html mails.
    • Default value:  "View portal"
    • in case of text email this parameter is ignored and the full URL will be generated
renders a link to the portal with a custom text.#renderLinkToPortal("View Customer Portal")
#renderLinkToPortalRequest($linkText)
  • $linkText: text to show for the link in html mails
    • Default value: "View request"
    • in case of text email this parameter is ignored and the full URL will be generated
renders a link to the request with a custom text.#renderLinkToPortalRequest("Open request")
#renderAllComments($comments)
  • $comments: The comments to render
Renders all comments (both public and internal) comments#renderAllComments($!issue.comments)

#renderChanges()


Renders the changelog in a readable structure#renderChanges()
#renderComments($comments)
  • $comments: The comments to render
Renders the public comments#renderComments($!issue.comments)
#renderCommentsInReverseOrder($comments)
  • $comments: The comments to render
Renders the public comments in reverse order#renderCommentsInReverseOrder($!issue.comments)
#renderCustomField($issue $customFieldKey)
  • $issue: the issue in the context
  • $customFieldKey
    • key of the custom field(eg. customfield_10001)
Renders the value of the custom field as displayed in jira#renderCustomField($!issue, 'customfield_10603')
#renderLastComment($issue)
  • $issue: The issue
Renders the last comment of the issue#renderLastComment($!issue)

...