Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

send email notifications of last comment of the ticket when status Declined

joanna_natial
Contributor
April 21, 2026

Hello,

Is there a JQL that can retrieve the last comment on a ticket? I’m creating an automation to send an email notification whenever the approval status is declined, and I’d like to include relevant ticket details along with the latest comment in the email body.
Thansks

3 answers

5 votes
Trudy Claspill
Community Champion
April 21, 2026

Hello @joanna_natial 

Have you already constructed your rule? Please provide screen images that show the entire rule.

JQL is intended to retrieve issues, not comments.

However within the context of an automation rule if you already have the issue then you can reference the body of the last comment on that issue with the smart value

{{issue.comments.last.body}}

Refer to

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.comments--

 

2 votes
Chris Hampshire
Contributor
April 21, 2026

Hi @joanna_natial 

As @Trudy Claspill has said above, JQL should be used to narrow down your scope of the automation.

Ive included a screenshot of an example automation rule that will resolve your issue.

You've mentioned in your post that you also want to include relevant details of the ticket, You can customise the email body to include smart values so you can display any field's value you want. Just be sure to use the customfield IDs if they are non system fields.

Screenshot 2026-04-22 075623.png

0 votes
Igor Medeiros - Modus Create
Atlassian Partner
May 6, 2026

Hi @joanna_natial

Trudy's pointer to {{issue.comments.last.body}} is the right native approach. Pair it with a "Send email" action triggered on approval status = Declined, and use {{issue.summary}}, {{issue.key}}, and {{issue.assignee.displayName}} alongside the comment smart value to assemble the body. Note that this captures only the single most recent comment.

If you need the last several comments, conditional routing per project, or a template editor with reusable layouts, our app Notification Assistant for Jira supports up to 10 prior comments and JQL-based triggers.

Feel free to reach out if you'd like to learn more.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events