Forums

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

Does the changelog smart value work for multi-line fields?

Kimmee Busby May 23, 2025

Hi everyone,

I'm trying to set up an automation rule that sends a web request when an issue is updated. I’m using the {{changelog}} smart value to capture what changes occurred. This is the simplified JSON body I’m sending in the web request:

{
"change_summary": "{{changelog}}"
}

When I change the description to a single-line value, the request works fine and the changelog includes the expected output (see first image).

changelog for single line of text.png

When I update the description to include multi-line text (another line of text underneath the first line), I receive a 422 error. Nothing in the changelog smart value seems to render, and the request fails due to invalid JSON (second image).

422 Error Code from 2 lines of text.png

I have tried using .jsonEncode and .urlEncode but that results in an empty string. 

Empty String with .urlEncode.png

If anyone has encountered this or knows a workaround to reliably capture and send multi-line field changes through the web request action, I’d really appreciate the help.

Thanks in advance!

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
May 23, 2025

Hi @Kimmee Busby -- Welcome to the Atlassian Community!

I am curious: why send the entire {{changelog}} that way rather than using the {{fromString}} and {{toString}} attributes for {{changelog.description}}?

Regardless of the "why"...

A quick test I did shows the {{toString}} ( and possibly the {{fromString}} ) contain newlines in the changelog for the case you describe.  And because you are trying to send the entire {{changelog}} without any parsing, it likely cannot use those encoding functions as you expect because it does not iterate over the attributes to apply the encoding.

Some possible workarounds are:

  • parsing out the fromString and toString to encode them separately,
  • replace the newlines with known characters, or
  • first store the entire {{changelog}} as a Created Variable (which flattens it to text), perhaps named varChangelog, and then encode that as {{varChangelog.jsonEncode}}

 

Kind regards,
Bill

Kimmee Busby May 24, 2025

Hi @Bill Sheboy , 

I appreciate you sharing your suggestions! 

As for the why not use the {{toString}} for {{changelog.description}}, I had only used the description field as an example of a multi-line field but I have this automation set for any updates to the work items. So ideally, the automation can be used for more use cases than just the description field. Additionally, I created an issue type that has multiple multi-line fields so I was trying to make the automation a little more generalizable. I have no issues trying that if nothing else works, so thanks for bringing that to my attention! 

Bill Sheboy
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.
May 24, 2025

Thanks for the clarifications.

Please try the workaround with the Create Variable action to see how that helps.  That approach will force the conversion to text before the encoding attempt to send to the endpoint.

Kimmee Busby May 28, 2025

@Bill Sheboy That solved the problem, thank you so much! 

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events