The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new line using addMessage to write lines to the Automation Audit log

Gisela Lassahn
Contributor
May 26, 2025

Hi community,

I've an automation rule using the action "Execute a ScriptRunner script" and am trying to write output with line breaks to the rule's Audit Log with addMessage, for example:

addMessage("1: a\r\nb\r\nc")
addMessage("2: a<br/>b<br/>c")
addMessage("3: a\\nb\\nc")
addMessage("4: a\u000Ab\u000Ac")
None of these variants work as expected.
The output is: 1: a b c, 2: a<br/>b<br/>c, 3: a\nb\nc, 4: a b c
Do you know a demonstrably effective method for this?
Many thanks and best regards,
Gisela Lassahn

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
May 26, 2025

Hello @Gisela Lassahn 

As far as I know, Audit Log renders output as a single line and does not interpret escape characters, line breaks or HTML tags. I believe this is the way how they prevent injection and being vulnerable to attacks.

Gisela Lassahn
Contributor
May 26, 2025

Hello @Tuncay Senturk _Snapbytes_ ,

thanks for your reply!

It sounds comprehensible.

Unfortunately you even don't get a new line if you use another addMessage().

Would that be a feasible suggestion to Atlassian or Adaptavist to start a new line for each addMessage()?

Or do you think they couldn't solve it?

 

Tuncay Senturk _Snapbytes_
Community Champion
May 26, 2025

Since the concatenation of separate addMessage messages occurs in the Jira Automation UI, it is on Atlassian's side. Therefore, raising a ticket to Atlassian support is a better option, but you could also ask Adaptavist for assistance, as they may have better insight into this issue. 

DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events