Forums

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

How to insert newline into string variable in Automation

Hugh Kelley
Contributor
June 6, 2023

I am creating a string variable as the first step in an automation rule.

The "Smart Value" is set to:

##FROM:{{issue.comments.last.author.emailAddress}}\n{{issue.comments.last.body}}

In a later step,  I use this variable with the {{var.asJsonString}} property.     The "\n" in the variable is not treated as a newline, it is escaped so that the resulting JSON string has a "\\n".

Is there any way to set the \n as a true newline in the variable-setting step?   Is there some sort of char() function I can use?

1 answer

0 votes
Frederik Vantroys
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.
June 6, 2023

Just a wild guess but what happens if you put everything between quotes ?

"issue.comments.last.author.emailAddress}}\n{{issue.comments.last.body"

Hugh Kelley
Contributor
June 6, 2023

Thanks.  I didn't try that because .concat() seemed to do the trick.

##FROM:{{issue.comments.last.author.emailAddress.concat("\n")}}{{issue.comments.last.body}}
Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events