- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 01:37 AM
Hi All,
getting an error message while updating the ticket "Unable to parse body to JSON". I have created a custom action to update the ticket in client application whenever short description , description and state is changed using flow designer
script :
var jsonPayload = {
"type":"UPDATE",
"data": JSON.parse(inputs['payload'])
}
outputs['request_body'] = JSON.stringify(jsonPayload);
gs.info("The output is:"+outputs['request_body']);
})(inputs, outputs);
I was getting the below error message while updating the ticket
Method failed: (/XXXXXXXXXXX/dev/tickets/CS00) with code: 400
{"Response":"Unable to parse body to JSON","ReceivedBody":"{\"type\":\"UPDATE\",\"data\":{\"clientTicketNumber\":\"CS0000198\",\"description\\n\":\"Testing for Changed fields updation\",\"status\\n\":\"Assess\",\"clientName\":\"srn\",\"short_description\\n\":\"Changed fields updation\",\"ticketType\":\"Change\"}}"}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 02:43 AM
Hi,
Try below script:
var jsonPayload = {
"type":"UPDATE",
"data": JSON.parse(inputs['payload'])
}
outputs['request_body'] = jsonPayload; // no need to stringify it
gs.info("The output is:"+outputs['request_body']);
})(inputs, outputs);
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 02:43 AM
Hi,
Try below script:
var jsonPayload = {
"type":"UPDATE",
"data": JSON.parse(inputs['payload'])
}
outputs['request_body'] = jsonPayload; // no need to stringify it
gs.info("The output is:"+outputs['request_body']);
})(inputs, outputs);
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 03:32 AM
Hi @Anil Lande Thank you this was working but now the below error is getting when we try testing this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 04:12 AM
Hi,
Check with third part team for the same. Looks like you have some API key that should match with another system.
It has nothing to do with your JSON Payload.
Thanks
Anil Lande