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

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);