# {{issue.comments}} in Jira Automation: examples

URL: https://goingstellar.ro/reference/smart-values/issue-comments/

{{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 29 Nov 2026.

```
{{issue.comments.last.body}}
```

Quote the latest comment in a notification.

Result:

```
Second comment: fixed in build 42
```

Run on Jira Cloud on 29 Nov 2026.

```
{{#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 29 Nov 2026.

```
{{issue.comments.last.body.abbreviate(14)}}
```

Shorten the latest comment for a Slack preview.

Result:

```
Second comm...
```

Run on Jira Cloud on 29 Nov 2026.

```
{{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 29 Nov 2026.

```
{{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 29 Nov 2026.

## 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](https://goingstellar.ro/reference/smart-values/issue-fields/)
- [{{assignee}}, {{reporter}}, {{creator}}, {{initiator}}](https://goingstellar.ro/reference/smart-values/user-smart-values/)
- [{{#list}}…{{/}} iteration](https://goingstellar.ro/reference/smart-values/list-iteration/)
- [first, last, get(), getFromEnd()](https://goingstellar.ro/reference/smart-values/list-first-last-get/)
- [join()](https://goingstellar.ro/reference/smart-values/list-join/)

## Sources

- [Jira smart values: issues (Atlassian Support)](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/)

