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

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 Leaders.
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 Leaders.
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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events