Versions Compared

Key

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

...

...

...

...

...

...

Redirect
delay3
filename
locationhttps://docs.meta-inf.hu/jeti-cloud/outgoing-emails/email-this-issue-for-jira-cloud-customizable-email-templates

Note
titleDocumentation moved

Thank you for visiting our old product documentation site. Note that we are in the process of migrating our product documentation and soon we will not store or update our documentation here. 

Please navigate to our new documentation site and update your bookmarks accordingly. If you're looking for the former content of this page, click here.

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

triggerType

Provides information about what type of event triggered the email sending.
Possible values:

  • OPERATION: The email is being sent manually

  • EVENT: The email is triggered by an issue event (created, commented... etc)

  • WORKFLOW: The email is triggered by a workflow transition

  • HANDLER: The email is triggered by a mail handler action

#if("$!triggerType" == "OPERATION")
<p>This is a manual email</p>
#end

prints 'This is a manual email' when the email was sent manually

enum

...

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 Management
    • "public": render Service Management public comments
    • "internal": render Service 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)
#renderVersions($versions)
  • $versions: the list of versions to render
Renders the versions.#renderVersions($!issue.fixVersions)
#renderComment()
Renders the body of a comment.

#set($comment = $!issue.lastComment)
#renderComment()

#renderComponents($components)

  • $components: the list of components to render
Renders the components.

#renderComponents($!issue.components)

#renderDate($dateValue $pattern $timezone)
  • $dateValue: 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 date field based on the pattern and the timezone.#renderDate($!issue.created "dd MMM yyyy" "Australia/West")

#renderLabels($labels)

  • $labels: the list of labels to render
Renders the lables.

#renderLabels($!issue.labels)

#renderList($listitems)
  • $listitems: the list of items to be rendered
Renders the items into a bullet list.#renderList($!issue.affectedVersions)
#renderIssueType($issue)
  • $issue: the issue whose type is to be rendered
Renders the type of the issue.#renderIssueType($!issue)
#renderStatus($issue)
  • $issue: the issue whose status is to be rendered
Renders the status of the issue.#renderStatus($!issue)
#renderPriority($issue)
  • $issue: the issue whose priority is to be rendered
Renders the priority of the issue.#renderPriority($!issue)
#renderUser($user)
  • $user: the user to be rendered
Renders the user.#renderUser($!issue.assignee)

#renderAllCustomFields($issue)

  • $issue: the issue whose custom fields are to be rendered
Renders the value of all custom fields on an issue.#renderAllCustomFields($!issue)

#renderCustomFieldValue($fieldValue)

  • $fieldValue: the value of a custom field to be rendered
Renders the value of a custom field.#renderCustomFieldValue($!issue.getCustomFieldValue('customfield_10603'))
#renderWorklog()
Renders the worklog in details.#renderWorklog()
#footer()
Renders the Email This Issue footer.#footer()

...