No output using issue.comments.last in Server Automation

Chris Jost
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2025

Hi all,

I'm looking to send an automated email with the hyperlinked key, summary, and the last comment on an issue. I attached a picture of how it is currently set up. However, in my testing, there is nothing returned for the last comment, despite there being plenty of comments on the issues. Can you please help show me where I went wrong!Screenshot 2025-01-26 224148.png

3 answers

1 vote
Vishal Biyani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2025

@Chris Jost 
Since you are using {{issue.comment.last}} inside {{#issues}}, that is one of the problems.

if you take it out and have something like this, it works.

<tr>
<td>{{issue.comment.last.body}}</td>
</tr>

1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2025

Hi Chris - Welcome to the Atlassian Community!

Try {{issue.comments.last.body}}

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2025

Hi @Chris Jost -- Welcome to the Atlassian Community!

Your rule is using the bulk-handling smart value {{issues}} to iterate over the issues found.  Once inside the iterator, just use the field's smart value to access it.

For example:

{{#issues}}
* {{key}} -- {{summary}}: {{comments.last.body}}
{{/}}

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer