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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.