Forums

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

Is it possible to change the order of comments when Sending Email from Jira Automation?

Andrey
Contributor
January 26, 2023

Hi folks,

 

We have an automation rule where we use the Send Email action, and send a list of comments on the issue.

The list of comments sends successfully via email, but it is sent in chronological order (so oldest comments are first). We want to reverse this sequence, so the newest comment is shown first.

In the actual issue in JSM, the comments are properly sequenced with newest on top. But the automation rule ignores that and sends in chronological order.

If anyone knows how to reverse the sequence of comments please let me know!

 

Thanks,

Andrey

 

<strong>Issue comments: </strong>
{{#issue.comments}}
<li>Comment by: <strong>{{author.displayName}}</strong> at: <strong>{{created.shortDateTime}} GMT</strong> :
{{body}}
<br>
{{/}} </li>

1 answer

1 accepted

1 vote
Answer accepted
Andrey
Contributor
January 27, 2023

We solved this issue after further research. The solution is very simple:

 

{{#issue.comments.reverse}}

 

Adding .reverse will show the comments with the latest comment first.

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