Automation basics
Understand the general concepts and best practices of automation in Atlassian cloud products.
Check out how we use smart values in our Jira automation template library.
The following smart values are available to access and format the value of items in a list when setting up a rule.
Iterates over a list and prints it. This smart value can reference further methods and properties.
{{issue.fixVersions.name}}
Finds the average of all numbers in a list.
{{issue.subtasks.Story Points.average}}
Returns all items in a given list, without duplicate items.
Let’s say you want to gather a list of issues, and print a list of parent issues but without duplicates. You could use the Lookup issues action to gather your list of issues, and then use {{lookupIssues.parent.distinct}} to print all unique issue summaries.
Returns true if a list is empty, and false if the list isn't. For example, can be used to see if an issue has any issue links.
1
2
3
{{#if(not(issue.issuelinks.isEmpty))}}
This bug has {{issue.issuelinks.size}} related tickets
{{/}}
Iterates over a list and prints out items separated by the given characters. The smart value below prints the names of fix versions and join them together with " - ".
{{issue.fixVersions.name.join(" - ")}}
Iterates over a list and prints it. This smart value reference multiple further methods and properties.
{{#issue.fixVersions}}{{name}} {{releaseDate}}, {{/}}
Iterates over a list of labels and prints it (. is a short hand to refer to the current item being iterated).
{{#issue.labels}}{{.}}, {{/}}
The element at the specified index, where 0 denotes the first element in the array.
{{lookupIssues.get(0).summary}}
The element at the specified index from the end, where 0 denotes the last element in the array.
{{issue.comments.getFromEnd(1).body}}
The first item in a list. The example below is for the body of the first comment.
{{issue.comments.first.body}}
The last element of a list.
{{issue.comments.last.author}}
Finds the highest number in a list, or finds the latest date in a list.
{{issue.subtasks.Due date.max}}
Finds the small number in a list, or finds the earliest date in a list.
{{issue.fixVersions.releaseDate.min}}
The size of the list.
{{issue.comments.size}}
Finds the sum of all values in a list.
{{issue.subtasks.Story Points.sum}}
Iterates over the list and only enters the first block on the first element. Can also use _first if the element has a method or property called first.
{{#list}}{{#first}}..{{/}}{{/}}
Prints all comment bodies and places First: in front of the first comment.
{{#issue.comments}}{{#first}}First:{{author.key}}{{/}}{{body}}{{/}}
Iterates over the list and only enters the last block on the last element. Can also use _last if the element has a method or property called last.
{{#list}}{{#last}}..{{/}}{{/}}
Prints all comment bodies and places "Last:" in front of the first comment.
{{#issue.comments}}{{#last}}Last: {{/}}{{body}}{{/}}
Iterates over the list and enters the first block on every element except the first element. Can also use _first if the element has a method or property called first.
{{#list}}{{^first}}..{{/}}{{/}}
Prints all comment bodies and places Not First: in front of all comments except the first.
{{#issue.comments}}{{^first}}Not First:{{author.key}}{{/}}{{body}}{{/}}
Iterates over the list and enters the last block on every element except the last element. Can also use _last if the element has a method or property called last.
{{#list}}{{^last}}..{{/}}{{/}}
Prints all comment bodies and places a comma after each except the last comment.
{{#issue.comments}}{{body}}{{^last}},{{/}}{{/}}
Prints the index of the current item. Can also use _index if the element has a method or property called index.
{{#list}}{{index}}{{/}}
As above, but prints the index of the comment in front.
{{#issue.comments}}{{index}}. {{body}}{{^last}},{{/}}{{/}}
Prints all labels each with a prefix of option-, and places a comma after each, except the last label.
{{#issue.labels}}option-{{.}}{{^last}},{{/}}{{/}}
Was this helpful?