Going Stellar

Home/Smart values reference

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:

2

Run on Jira Cloud on .

{{issue.summary.split(" ").size}}

Count the words of the summary by splitting it first.

Result:

2

Run on Jira Cloud on .

{{issue.issuelinks.isEmpty}}

Test whether the work item has any linked work item at all.

Result:

true

Run on Jira Cloud on .

{{issue.comments.isEmpty}}

Test whether anybody commented yet.

Result:

false

Run on Jira Cloud on .

This bug has {{issue.issuelinks.size}} related tickets

Build a sentence around a count. The number is 0 when there are no links.

Result:

This bug has 0 related tickets

Run 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.

Sources

  1. Jira smart values: lists (Atlassian Support)

Markdown version · All smart values