Forums

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

What should I change in the code below to sort the comments from newest to oldest?

Talha Aras
Contributor
February 14, 2024

Hello,
I inform you via e-mail via Jira. I do this by using automation. What should I change in the code below to sort the comments from newest to oldest?
Kind regards.

 

<p>
{{#issue.comments}}
<span class="icon icon-person">👤</span> {{author.displayName}} {{created.format("dd/MM/yyyy")}} tarihinde:<br><span class="icon icon-comment">💬</span> {{body}} <br> <br>

{{/}}
</p>


2 answers

1 accepted

0 votes
Answer accepted
Talha Aras
Contributor
February 15, 2024

So which part should I replace? Thank you very much for your quick return.

Talha Aras
Contributor
February 15, 2024

I found it,

When you add .reverse

ex: {{#issue.comments.reverse}} it solved,

 

2 votes
Walter Buggenhout
Community Champion
February 15, 2024

Hi @Talha Aras,

You can return a list of comments like this:

{{issue.comments.body}}

 And reverse the order of comments like this:

{{issue.comments.reverse.body}}

See smart value documentation for more details.

Hope this helps!

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