The CreatorCon Call for Content is officially open! Get started here.

When updating the "Description" field in Jira using the Jira Spoke, it is adding the \n and \r

jonathangilbert
Kilo Sage

Hi All

 

I am using the Jira spoke to create and update tickets. The issue I have is that if I update the description field in ServiceNow, it is passing it through to the Description field in Jira with /n and /r if the description in servicenow is on different lines, for example

 

In servicenow:-

Description Line 1
Description Line 2

 

Looks like this in Jira 

Description Line 1\r\nDescription Line 2

 

How can I get the formatting of the Jira field to match that of ServiceNow?

 

I am using the OOB "Update isse" action, which is being triggered via a Business Rule, with the below script:-

 

(function() {
    
    try {
        var inputs = {};
        inputs['short_description'] = current.short_description.toString(); // String 
        inputs['description'] = current.description; // String 
        inputs['jira_id'] = current.u_jira_id;
        inputs['caller'] = current.requested_for.name.toString(); // String

        // Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.
        // sn_fd.FlowAPI.getRunner().subflow('global.update_jira_not_comments').inBackground().withInputs(inputs).run();
                
        // Execute Synchronously: Run in foreground. Code snippet has access to outputs.
        var result = sn_fd.FlowAPI.getRunner().subflow('global.update_jira_not_comments').inForeground().withInputs(inputs).run();
        var outputs = result.getOutputs();

        // Current subflow has no outputs defined.      
    } catch (ex) {
        var message = ex.getMessage();
        gs.error(message);
    }
    
})();

 

0 REPLIES 0