Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,269
Community Members
 
Community Events
165
Community Groups

Get Multiple Comments displayed on separate lines in automated email

Edited

I want to have each comment made within an Issue to be displayed in an automated email with each comment on it's own line for readability, but don't know what to place to give line breaks.

This is what I have written for automating an email when condition is met:

Project: {{project.name}}

Issue Key: <a href="https://skdyproductexperience.atlassian.net//browse/TE">({{issue.key}})</a>
Status: {{issue.status.name}}
Description Summary:
{{description}}
Comment Body:
{{issue.comments.body}}

where each comment in the issue for test purposes:

1, 22, 333, 4444, 55555, 666666

and it results in:

Project: x-xx

Issue Key: (xx-xx)
Status: To Do
Description Summary:
i wrote this description here
Comment Body:
122333444455555666666

Desired result:

1

22

333 etc.

1 answer

1 accepted

1 vote
Answer accepted
Andy Heinzer Atlassian Team May 27, 2022

Hi Zachary,

This is possible to do with some of automation smart values.  Specifically see the examples in Jira smart values - lists.  Automation will need to treat those comments like they were a list for this to work.

Try changing your Comment Body: line value to be:

Comment Body:
{{#issue.comments}}{{body}}{{^last}},

{{/}}{{/}}

 

This will add a comma, and then 2 carriage returns after all the comments except for the last comment.  Of course, you could remove the comma if you like, but this approach should be able to format that email in the way I think you are looking for here.

Andy

Like Andy Heinzer likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

256 views 1 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you