Going Stellar

Home/Smart values reference

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:

2

Run on Jira Cloud on .

{{issue.comments.last.body}}

Quote the latest comment in a notification.

Result:

Second comment: fixed in build 42

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

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

Run 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+0000

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

Sources

  1. Jira smart values: issues (Atlassian Support)

Markdown version · All smart values