Going Stellar

Home/Smart values reference

Jira Automation smart value

List first, last, get() in Jira Automation: examples

first and last return the ends of a list. get(index) counts from the start and getFromEnd(index) counts from the end, both starting at 0. Use them to read the latest comment, the first label or one word of a split text.

Syntax

{{list.first}}
{{list.last}}
{{list.get(index)}}
{{list.getFromEnd(index)}}

Arguments

ArgumentWhat it isRequired
indexThe position of the item. For get() 0 is the first item, for getFromEnd() 0 is the last one.yes

Works on

  • Fields: any list, such as issue.comments, issue.labels or the result of split().
  • Returns: one item, so you can read its properties with a dot.

Examples

{{issue.comments.last.body}}

Quote the most recent comment in a notification.

Result:

Second comment: fixed in build 42

Run on Jira Cloud on .

{{issue.comments.first.body.left(5)}}

Chain a text function on the first comment to keep a short preview.

Result:

First

Run on Jira Cloud on .

{{issue.comments.get(1).body}}

Read the second comment by position. Counting starts at 0.

Result:

Second comment: fixed in build 42

Run on Jira Cloud on .

{{issue.comments.getFromEnd(1).body}}

Read the comment before the latest one.

Result:

First comment from QA

Run on Jira Cloud on .

{{issue.labels.first}}

Use the first label as the main category of the work item.

Result:

checkout

Run on Jira Cloud on .

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

Take the last word of the summary after splitting it on spaces.

Result:

World!

Run on Jira Cloud on .

Pitfalls

  • An index past the end of the list renders an empty string: {{issue.labels.get(5)}} and {{issue.labels.getFromEnd(5)}} both come out blank (checked on Jira Cloud, November 2026). Check the size first when a blank would break the next step.
  • A negative index is an error, not a way to count from the end. {{issue.labels.get(-1)}} fails with Failed to get value for issue.labels.get(-1). Use getFromEnd(0) for the last item.
  • A user property such as issue.comments.last.author renders the account id. Add .displayName when people will read the message.

Sources

  1. Jira smart values: lists (Atlassian Support)

Markdown version · All smart values