I'm running some automation that displays any items that were checked off for a custom multi checkbox. The default way it displays is each value separated by a comma. Ideally I'd like for each item to be displayed on a new line. Can I format it so it displays that way?
So right now I have:
Service {{issue."Services affected"}}
and when the automation runs and send the email it shows:
item1, item2, item3, item4
I'd like it to be:
item1
item2
item3
item4
Here's how I did it
{{#issue."Services affected"}}Service {{.}}{{^last}}
{{/}}{{/}}
The "^last" block (starting with `{{^last}}` and ending with `{{/}}`) is included for all elements except the last. Inside this block there is a newline.So for all the items except the lines the newline will be added at the end.
`{{.}}` signifies a current item when iterating.
Reference: https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/
Hi @Dennis_H
You mention solving this with automation. Have you tried to either use the replaceAll() function to substitute a newline for the commas, or use split() and join() to do the same thing?
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you assist with what the syntax for that would be? I'm not the expert on smart values in JA.
This is the actual line I'm using to display the checked values.
Service {{issue."Services affected"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dennis_H
A lot about using automation rules is experimentation, so I encourage you to try things to learn what does and doesn't work. The documentation will not have all of the answers for every use case, so consider writing a rule, and if you have a problem then post that rule and the audit log for the community to offer help.
To do what I was suggesting, you could:
{{varServicesAffected.replaceAll(",", "\n")}}
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The create variable method seems a bit much when you can easily use the join syntax:
{{issue.Services affected.join("<br> </br>")}}
Result:
item1
item2
item3
item4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.