Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×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!
@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>
Hi Vishal, thank you so much for the reply! Unfortunately that still shows no output:
I do have "process all issues in bulk" turned on though
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is the working code. You can adjust the message according to your need. You don't need to use issues.comments as you are iterating via issues already.
The {{issues.size}} issues listed below
<table border="1" cellpadding="2" >
<tbody>
{{#issues}}
<tr>
<td><a href {{url}}>{{key}}</a></td>
<td><a href {{url}}>{{summary}}</a></td>
<td> {{comments.author.displayName}} </td>
<td> {{comments.last.body}} </td>
</tr>
{{/}}
</tbody>
</table>
Thanks @Bill Sheboy for your input
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all, this may be a silly question but how can I paste my code within here for future reference? Every time I try it gets formatted automatically. Thank you so much for the support as I'm very new to this!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Rich Text...under the "Formats" dropdown there is a "Code block" option for fixed-font. Yet that "zaps" spacing when pasted in as text...requiring aligning text.
You could also try the HTML format to see if that helps preserve it better.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris - Welcome to the Atlassian Community!
Try {{issue.comments.last.body}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John, unfortunately this still didn't give an output :( I really appreciate your help!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill, unfortunately comments.last.body did not return any output in my format :( I really appreciate the help!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please re-read my post and the documentation link I provided...
When inside the iterator {{#issues}} ... {{/}} the issue prefix is not used; instead the scope is the iterator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.