How to search Jira by last comment date
Short answer
Jira Cloud has no built-in JQL field for when a work item was last commented on, who commented, or how many comments it has. The closest native option is updated, which changes on every edit, not just comments. To search or sort by the last comment you need a field that stores it: either one you maintain with an Automation rule, or one maintained by an app.
What Jira's JQL can and cannot do with comments
| Query | Result on Jira Cloud |
|---|---|
comment ~ "refund" | Valid. Finds work items where any comment contains the text. |
updated < -7d | Valid, but updated moves on any change: a status change, a label, a field edit. It is not the last comment date. |
lastCommentedDate < -7d | Invalid: "Field 'lastCommentedDate' does not exist or you do not have permission to view it." |
commentCount = 0 | Invalid: "Field 'commentCount' does not exist or you do not have permission to view it." |
comment is EMPTY | Invalid: "The field 'comment' does not support searching for EMPTY values." |
Atlassian's public request for this, JRACLOUD-2734 (show the last comment as a column), has been open since 2003.
Workaround: an Automation rule
You can approximate a last comment date with Jira Automation:
- Create a date-time custom field, for example "Last commented", and add it to the relevant screens.
- Create a rule with the trigger Work item commented.
- Add the action Edit work item and set your field to
{{now}}. To keep the text as well, set a text field to{{comment.body}}.
Limits to know before you rely on it:
- It only fills in work items commented on after the rule exists. There is no backfill for existing work items.
- Every comment uses a rule run, and rule runs are capped per month depending on your plan.
- Deleting the latest comment does not roll the field back to the previous comment.
- Writing the field is itself an edit, so it also moves
updatedand appears in the work item's history. - It gives you no comment count and no way to tell a public reply from an internal note in a service project.
With an app: real fields
Last Comment Fields for Jira (ours) maintains five read-only fields on every work item: Last comment, Last comment author, Last comment date, Last comment visibility and Comment count. They backfill on install, update within seconds of a comment being added or deleted, and use no automation rule runs. Then plain JQL works:
"Last comment date" < -7d AND resolution IS EMPTY
"Comment count" = 0 AND created < -3d
"Last comment visibility" = internal
"Last comment author" = currentUser() ORDER BY "Last comment date" DESC
The same fields work as list columns, on dashboards and in CSV exports. Scripting suites such as ScriptRunner also offer comment-related JQL functions, if you already run one.
Common questions
Can I sort a filter by last comment?
Not natively. You can sort by updated. With a stored field you can ORDER BY "Last comment date".
How do I find service requests where the customer is still waiting?
Natively you would build this around SLAs or the "Waiting for support" status. With the fields above, "Last comment visibility" = internal finds requests whose most recent comment was an internal note rather than a public reply.
Does the text field use exact match?
App-provided text fields are matched exactly: write =, not ~.