Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Formating email message creeated by Jira Automation in the Jira cloud

Jacek February 11, 2022

Hello, our company is facing some difficulties with formatting used in automation. 

Right now I am working on sending content of the last comment added to the issue. 

I am able to acquire this content by this smart value: 


{{issue.comments.last.body}} 

I have 2 main problems with this value. 

1. When someone write exclamation mark "!" I will get exclamation mart with slash "\!"

2. When someone will use color i am getting these markup in this content, for example {color:red} Mother {color}. I want to get rid of this markup, even at a cost of loosing this colorfull information. 

I have tried to replace these text marks, but these expressions...: 

a) {{issue.comments.last.body.replaceAll("({color.*})","")}} 

b) {{issue.comments.last.body.replaceAll("(\\{color.*\\})","")}} 

c) {{issue.comments.last.body.replaceAll("\\{color.*\\}","")}} 

... returns only errors. I expect that it is because i want ot replace these brackets {}, but I really want to replace of them.

Can someone advise how to do this? Any workaround will also be appreciated. 

2 answers

4 votes
Brian Bandy September 12, 2022

I found this document that solved this problem for me.

Convert wiki markup to HTML or plain text in Jira automation 

Basically, for the text field you are including, add ".html" or ".text" to the end of the field name inside the double-braces.

e.g.: {{issue.description.html}}

eilon_elphi August 5, 2023

Super helpful!

 

in ".html" mode, it adds weird extra spacing before and after the field. Is that expected?

also, if the field does have some numbered lists in it, it adds additional spacing on top of the extra spacing pre and post field. so it looks kinda terrible.

 

any suggestions?

Ihor Pavlenko December 27, 2023

@eilon_elphi  In your "Send email" action click on "More options" and uncheck the "Convert line breaks to HTML line breaks" checkbox. Probably that may help.

0 votes
Boris Berenberg - Atlas Authority
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.
February 14, 2022

Not sure about a fix in Jira Automation, but we had to create our own markup parser in Notification Assistant for Jira. It handles most of these scenarios, but we still have some special edge cases where we need to improve. Unfortunately there isn't a parsing library that Atlassian has made available, and seemingly this is true even for internal tools.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events