Jira Cloud guides

Jira automation smart values for comments: get the last comment, its author and visibility

Short answer: Use {{issue.comments.last.body}} for the latest comment on any trigger, and {{comment.body}} for the comment that triggered the rule when the trigger is Work item commented. We ran each smart value on this page in a rule on a Jira Cloud site in November 2026, and note what came back.

Two families of smart values

1. The comment that triggered the rule: {{comment}}. Atlassian documents it for the Work item commented trigger. It is not for other triggers, even when a comment was added as a result.

2. The comments on the work item: {{issue.comments}}. It works with any trigger.

Three example rules

We ran rules 2 and 3 on a Jira Cloud site. Rule 1 uses the same smart values in an email action, which we did not run.

1. Notify on a new comment. Trigger: Work item commented. Action: Send customized email (the older Send email action is deprecated). Subject: {{comment.author.displayName}} commented on {{issue.key}}. Body: {{comment.body}}. {{comment.body}} also returns restricted comments (see below), so add the condition from rule 2 if the recipients can't see them.

2. Show the last comment in a field, skipping restricted comments.

  1. Create the fields: Last comment (Paragraph), and optionally Last commented by (User picker) and Last comment date (Date time picker).
  2. Trigger: Work item commented.
  3. Condition: Advanced compare on {{comment.visibility.type}} so the rule continues only when it is empty (an unrestricted comment).
  4. Action: Edit work item. Set Last comment to {{comment.body}} and Last comment date to {{now}}. If a field type won't take a smart value in Choose fields to set, use More options with JSON. We set a User picker this way: {"fields":{"customfield_10100":{"accountId":"{{comment.author.accountId}}"}}} (use your own field's ID). Atlassian recommends More options only for fields that can't be set with Choose fields to set.

3. Name the last commenter. Any trigger. Action: Comment on work item. Text: {{issue.comments.last.author.displayName}} has left a comment on {{issue.key}}.

Why the last comment can come back empty (actor and visibility)

Restricted and internal comments

A rule copies whatever the smart value returns. In our test, {{comment.body}} put the full text of a role-restricted comment into a Paragraph field that anyone who can see the work item can read. Add the visibility condition from rule 2 and test it with a restricted comment before you turn the rule on. We haven't tested Jira Service Management internal notes in a rule: check {{comment.internal}} on a test work item first.

Gaps

When an app is simpler

Loomwise Comment Snapshot for Jira keeps Last comment, Last commented by and Last comment date as read-only fields without a rule to maintain. You can use them as list view columns, in JQL, in filters and dashboards, and in CSV export. In our tests it updated within seconds of a new or edited comment, picked up a deletion after about three minutes, and ignored restricted comments. As noted above, the fields aren't readable from Automation. Free for up to 10 users, about $0.35 per user per month above that, billed through Atlassian.

Get Comment Snapshot on the Atlassian Marketplace   See how Comment Snapshot works

FAQ

How do I get the last comment in a Jira automation rule? Use {{issue.comments.last.body}} on any trigger. Use {{comment.body}} for the comment that triggered the rule when the trigger is Work item commented.

Why is {{issue.comments.last.body}} empty? The comments are read as the rule's actor. In our test, with the default Automation for Jira actor and only restricted comments on the work item, {{issue.comments.size}} was 0 and the last-comment values were empty. With a user who belongs to the restricting role as the actor, all comments came back.

Does editing a comment re-run a Work item commented rule? No. In our test an edit did not run the rule, and Atlassian says the same. Atlassian's trigger list has a separate Work item comment edited trigger.

Can I copy a comment into a field without exposing a restricted comment? Yes, if you add a condition that skips restricted comments, for example an Advanced compare on {{comment.visibility.type}} that only continues when it is empty. Without it, our test copied a restricted comment in full into a Paragraph field.

Related guides

Disclosure: Loomwise makes the app mentioned in the card above and wrote this guide. Not affiliated with Atlassian. Smart values tested on a Jira Cloud site in November 2026; Atlassian's smart values page is the reference. Last checked November 2026; Jira menus and features change, so verify in your site. Contact: hello@loomwise.app