Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

 If-else
<--! Checks a custom gender field and generates the salutation accordingly -->
{{#if (exists issue.customfield_11111)}}
{{#eq issue.customfield_11111 "m"}} <!-- check for the specific field value "m" -->
Dear Sir
{{/eq}}
{{#eq issue.customfield_11111 "f"}} <!-- check for the specific field value "m" -->
Dear Madam
{{/eq}}
{{else}} <!-- if the field is empty -->
Dear Sir or Madam
{{/if}}
 Compare values via OR
{{#or (eq issue.priority.name "Medium") (eq issue.priority.name "High")}}
<!-- this will be executed if the issue's priority is either Medium or High -->
{{/or}}
 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 -->
{{/if}}
 Loop over an array
<!-- Prints all people watching the issue -->
{{#each issue.watchers}}
{{this.displayName}}
{{/each}}
 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}}
{{/each}}
 Filter an array on a specific property
<!-- Prints all comments from the issue's creator -->
{{#filter issue.comment issue.creator.accountId prop="author.accountId"}}
Created: {{format this.created.raw "dateMed"}}
{{this.body}}

{{/filter}}
  • No labels