I'm creating email notification for when a new comment is added under certain circumstances and am having a little trouble with the comment sort order.
I'm using the example text from this page
<b>COMMENTS</b>
{{#issue.comments}}
Comment by: {{author.displayName}} at: {{created.format("dd/MM/yyyy HH:mm a O")}}
{{body}}
However I would like it to show the most recent comment first.
How can I do this ?
Hi Catherine,
have you tried {{issue.comments.reverse.body}}?
That should return the issue's comments but in reverse order.
Cheers,
Peter
I updated my email text to try that and it didn't send any information in the email about each comment.
What I changed the text to:
<b>{{issue.key}}-{{issue.summary}}</b>
Link to Issue : {{issue.url}}
{{#issue.comments.reverse.body}}
<b>{{created.format("dd/MM/yyyy HH:mm a O")}}</b>
<i>{{author.displayName}}</i>
{{body}}
---
{{/}}
What it sent :
ABC-123-JIRA - Create automation for comments
Link to Issue : url_to_issue.com
---
---
I also tried without the # but then it errored and wouldn't send
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Catherine can you please try
{{#issue.comments.reverse}}
<b> {{created.format("dd/MM/yyyy HH:mm a 0")}}</b>
<i>{{author.displayName}}</i>
{{body}}
---
{{/}}
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.
That should return the issue's comments but in reverse order. Which i am using as a Mepco Bill Rate. An Electricity provider
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.