The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Get a non internal comment of Ticket

Hais_ Pedro
March 20, 2025

 

Good afternoon! I hope everyone is doing well.

I have tried this:

{{#issue.comments}}{{^internal}}{{last}}{{body}}{{/internal}}{{/issue.comments}}

but it returns all non-internal comments, whereas I only need the last one.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

7 votes
Answer accepted
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 Champions.
March 20, 2025

Hi @Hais_ Pedro 

I do not believe the list conditionals and blocks can be merged that way.

A workaround might be to first filter on internal, saving the results in a variable with a delimiter; split() with the delimiter back into a list and grab the last entry:

  • action: create variable
    • name: varNonInternalComments
    • value: {{#issue.comments}}{{#if(not(internal))}}{{body}}~~{{/}}{{/}}
  • something that needs the latest, non-internal comment:
    • {{varNonInternalComments.split("~~").last}}

Kind regards,
Bill

Hais_ Pedro
March 21, 2025

Thank you so much again, Bill

Like Bill Sheboy likes this
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 Champions.
March 21, 2025

Just to confirm, did that solve the question?

If so, please consider marking this question as "answered" to help others with a similar need find solutions faster.  Thanks!

Like Hais_ Pedro likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events