Skip to main content
Skip table of contents

Template Examples

<!-- Checks a custom gender field and generates the salutation accordingly -->
{{#if (exists issue.customfield_11111.raw)}}
{{#eq issue.customfield_11111.raw "m"}} <!-- check for the specific field value "m" -->
Dear Sir
{{#eq issue.customfield_11111.raw "f"}} <!-- check for the specific field value "m" -->
Dear Madam
{{else}} <!-- if the field is empty -->
Dear Sir or Madam
Compare values via OR
{{#or (eq "Medium") (eq "High")}}
<!-- this will be executed if the issue's priority is either Medium or High -->
Check if a value is set and NOT a specific value
{{#and (exists issue.summary) (compare issue.summary != "Test")}}
<!-- this will be executed if the issue summary is set but different then "Test"-->
Modify a datetime and compare it
{{setVariable "14DaysAgo" (subtractDay now 14)}}
{{#if (isBeforeDay issue.created.raw 14DaysAgo)}}
<!-- this will be executed if the issue was created more than 14 days ago -->
Loop over an array
<!-- Prints all people watching the issue -->
{{#each issue.watchers}}
Map an array's property to a new array and loop over it
<!-- Prints all authors in the format "#. Name" -->
{{setVariable "commentAuthors" (pluck issue.comment "author.displayName")}}
{{#each (unique commentAuthors)}}
{{add @index 1}}. {{this}}
Filter an array on a specific property
<!-- Prints all comments from the issue's creator -->
<!-- for Jira DC it would be issue.creator.key // author.key -->
{{#filter issue.comment issue.creator.accountId prop="author.accountId"}}
Created: {{format this.created.raw "dateMed"}}

Look for first/last entry of an array
<!-- Prints the last comment of an issue -->
{{#withLast issue.comment}}

<!-- Prints the filename of the first attachment of an issue -->
{{#withFirst issue.attachment}}

Check on field values and print different outcomes
<!-- Returns depending on the value of a multiselectfield of an issue -->
{{#eq issue.customfield_11111 "Yes"}}

This is the Yes block

{{#eq issue.customfield_11111 "No"}}
This is the no block


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.