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

How to add newlines in Json payload for submitting a webRequest in automation

Adolfo Casari
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.
August 28, 2024

I have created a variable

comment = *{{issue.comments.last.author.displayName}} commented*: {{issue.comments.last.body}}

then I create a comment using a webrequest action , the custom data for the request is:

{ "issues":["{{webhookResponse.body.object.title}}"], "data": {"comment":"{{comment.jsonEncode}}"} }

The comment is created OK, but I need to add couple of newlines between:

*{{issue.comments.last.author.displayName}} commented*:  and

{{issue.comments.last.body}}

I've tried adding in between both:

\n\n (prints \n\n in the comment)

\\n\\n (prints \\n + newline + n)

Thanks for your suggestions,

 

1 answer

1 vote
Adolfo Casari
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.
August 28, 2024

In case someone runs into the same issue, use: \\ (for a single newline)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events