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