Jira Automation smart value
{{issue.comments}} in Jira Automation: examples
{{issue.comments}} is the list of comments on the active work item. Reach one comment with first or last, count them with size, or loop over all of them with the # syntax.
Syntax
{{issue.comments.first.body}}
{{issue.comments.last.body}}
{{#issue.comments}}{{body}}{{/}}
Works on
- Fields: comments of the active work item
- Returns: a list of comments; each has body, id, created and author
Examples
{{issue.comments.size}}Count the comments, for example to branch when there are none.
Result:
2Run on Jira Cloud on .
{{issue.comments.last.body}}Quote the latest comment in a notification.
Result:
Second comment: fixed in build 42Run on Jira Cloud on .
{{#issue.comments}}{{body}}{{^last}} | {{/}}{{/}}Join every comment into one line with a separator that is skipped after the last one.
Result:
First comment from QA | Second comment: fixed in build 42Run on Jira Cloud on .
{{issue.comments.last.body.abbreviate(14)}}Shorten the latest comment for a Slack preview.
Result:
Second comm...Run on Jira Cloud on .
{{issue.comments.last.body.substringAfter(": ")}}Keep only the text after the label of a comment that starts with a prefix.
Result:
fixed in build 42Run on Jira Cloud on .
{{issue.comments.last.created}}The time of the latest comment, as a date you can compare or format.
Result:
2026-11-29T16:19:43.4+0000Run on Jira Cloud on .
Pitfalls
- A list in a text field is joined with commas.
{{issue.comments.body}}prints every body in one string separated by ", ", which is hard to read when a comment itself contains a comma (checked on Jira Cloud, November 2026). - {{comment.body}} belongs to the comment triggers. With a manual trigger it still rendered, but as all comments joined together, not one comment.
- Inside
{{#issue.comments}}you write{{body}}, not{{issue.comments.body}}. The loop already sits on one comment.
Related
- {{issue.key}}, {{issue.summary}} and other issue fields
- {{assignee}}, {{reporter}}, {{creator}}, {{initiator}}
- {{#list}}…{{/}} iteration
- first, last, get(), getFromEnd()
- join()