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

Handling Special Characters in JSON Webhook Requests in Jira Service Management

nitsarut
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 27, 2024

 

Hello, I using Jira Service Management for ticket creation and have set up a webhook to filter statuses such as "approved" and "closed."
The webhook sends this data to global Automation. I’ve created a rule called send-request-HighPriv which uses the components Incoming webhook and Send web request. It uses the HTTP method POST with a custom body where Jira transforms the data into JSON. Here’s an example of the JSON: { "summary": "{{webhookData.issue.fields.summary}}" } I checked the audit log, but I received an error related to special characters. The error message was: Failed to parse the request body as JSON: expected `,` or `}` at line 2 column 34. After investigating, I found that the issue is due to special characters or quotation marks ("") in the summary field, which caused the error. Do you have any recommendations on how to handle this?

1 answer

0 votes
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

Try {{webhookData.issue.fields.summary.jsonEncode}}

Suggest an answer

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

Atlassian Community Events