Jira request body custom action error
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I found the solution. If I pass the regex value to the input variable it is working fine.
(function execute(inputs, outputs) {
if (inputs.description) {
var regex = /\\/gm;
var regex1 = /[\r\n\t\f\v ]{2,99}|\n/gm;
var regex2 = /\'|\"/gm;
outputstext1 = inputs.description.replace(regex,'\\\\'); // escape back slash
outputstext2 = outputstext1.replace(regex1,'\\n'); // replace line breaks and white space
outputs.jira_description = outputstext2.replace(regex2,'\\"'); //escape quotation marks
}
})(inputs, outputs);

