We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Jira request body custom action error

krishnanara
Tera Contributor

I'm trying to pass the catalog variable value to Jira from ServiceNow in flow designer using custom action, I see the status code 200 but I don't see the record created. The issue will be coming when I pass some text value & multiple fields in Summary & Description. it is working fine when I remove the text value and pass only one catalog variable value to the field I'm attaching the screenshot

krishnanara_3-1770504036989.png

 

krishnanara_4-1770504062711.png

 

krishnanara_5-1770504097188.pngkrishnanara_6-1770504155965.png

 

 





5 REPLIES 5

ghantachara
Tera Contributor

The issue is likely caused by improper JSON escaping when passing catalog variable values containing special characters (quotes, newlines, etc.) to Jira - even though you're getting a 200 status code, the request body is probably malformed. To fix this, add a Script step before your REST call that sanitizes the input using outputs.clean_summary = JSON.stringify(inputs.summary).slice(1, -1); and outputs.clean_description = JSON.stringify(inputs.description).slice(1, -1);, then use these cleaned variables in your custom action's request body instead of the raw catalog variables. Make sure you're using actual variable pills (dragged from the data picker) rather than typing variable names as text, and verify your headers include Content-Type: application/json. Also check the Response Body field even though the status is 200, as Jira sometimes returns success codes but includes error details in the body explaining why the issue wasn't actually created.

Ankur Bawiskar
Tera Patron

@krishnanara 

seems the JIRA API is expecting something different in request body

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

When I add the new line tag and the text \n Second line: directly in the request body it is taking the request body and creating the record in the separate line but when I pass through the flow designer it is not working

krishnanara_0-1770553160804.png

 




Any suggestion how to send the input variable?