Jira Automation smart value
List size and isEmpty in Jira Automation: examples
size returns the number of items in a list and isEmpty returns true or false. Use them to guard a message that only makes sense when links, comments or labels exist.
Syntax
{{list.size}}
{{list.isEmpty}}
Works on
- Fields: any list, such as issue.labels, issue.comments, issue.issuelinks or the result of split().
- Returns: a number for size, true or false for isEmpty. Both also work with parentheses.
Examples
{{issue.labels.size}}Count the labels on the work item.
Result:
2Run on Jira Cloud on .
{{issue.summary.split(" ").size}}Count the words of the summary by splitting it first.
Result:
2Run on Jira Cloud on .
{{issue.issuelinks.isEmpty}}Test whether the work item has any linked work item at all.
Result:
trueRun on Jira Cloud on .
{{issue.comments.isEmpty}}Test whether anybody commented yet.
Result:
falseRun on Jira Cloud on .
This bug has {{issue.issuelinks.size}} related ticketsBuild a sentence around a count. The number is 0 when there are no links.
Result:
This bug has 0 related ticketsRun on Jira Cloud on .
{{#if(not(issue.issuelinks.isEmpty))}}This bug has {{issue.issuelinks.size}} related tickets{{/}}Print the sentence only when links exist. With no links the whole block stays blank.
Run on Jira Cloud on .
Pitfalls
{{else}}is not an else branch. With a true condition both texts were printed one after the other, and with a false condition the else text was missing (checked on Jira Cloud, November 2026). Use two separate if blocks.- size counts items, not characters. For the length of a text use
length()on the text itself.