SamAtNAIT wrote:
I am trying to get the latest public comment and pass it to the 3rd application using web request in workflow automator. I am sure there is something in that field. However, I am not able to insert it into my JSON body to to send it the REST call. It throws the invalid JSON format error. I tried to add and remove the quotes around the bird lip brackets, still no luck.
Mine looks something like this:
{
"work_notes": "{{ticket.latest_public_comment}}"
}
Do I have to do anything different with it?
**sorry if this is in the wrong forum. My first post here **
Thanks,
Sam
Need to use this
Sanitize HTML content using sanitize_html Liquid Placeholder
Use the sanitize_html liquid filter to treat HTML placeholders so that they can be used within the body of an API request without an invalid JSON error being thrown.
For example:
{{ticket.description}} returns
"<div style='font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;'>\n<div>This is test.</div>\n</div>"
{{ticket.description | sanitize_html}} returns
"<div style='font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, \\\"Segoe UI\\\", Roboto, \\\"Helvetica Neue\\\", Arial, sans-serif;'>\\n<div>This is test.</div>\\n</div>"
And thus can be used within the body of an API request.
Can read about it here Powerful Placeholders with Liquid Filters : Freshservice
And Introduction – Liquid template language (shopify.github.io)