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
| Argument | What it is | Required |
|---|---|---|
index | The 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 42Run on Jira Cloud on .
{{issue.comments.first.body.left(5)}}Chain a text function on the first comment to keep a short preview.
Result:
FirstRun 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 42Run on Jira Cloud on .
{{issue.comments.getFromEnd(1).body}}Read the comment before the latest one.
Result:
First comment from QARun on Jira Cloud on .
{{issue.labels.first}}Use the first label as the main category of the work item.
Result:
checkoutRun 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 withFailed to get value for issue.labels.get(-1). Use getFromEnd(0) for the last item. - A user property such as
issue.comments.last.authorrenders the account id. Add.displayNamewhen people will read the message.