cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax issue with Zendesk New/Updated Ticket Description and creation in Jira

chrisjgreen08
Deputy Chef I
Deputy Chef I

I am setting up a recipe that takes a new/updated Zendesk ticket (in real time) and then creates the issue in Jira. I'm running into an issue with the 'Description' output for the 'New/updated ticket in Zendesk' action. The description comes back formatted as Zendesk HTML (or the equivalent) with line breaks. I'm using the Jira 'Create Issue' API to create my Jira issue passing in the description as is results in a syntax error. If I manually remove the line breaks and replace them all with \n and run the API call, it's successful and displays correctly in my Jira issue (apparently \n is what Jira uses for line breaks). 

So now my question..... is there anyway I can replace the line breaks within Workato with \n so I can get my recipe to run successfully? 

 2024-06-05_08-15-43.png

2024-06-05_08-19-43.png

1 REPLY 1

gary1
Executive Chef III
Executive Chef III

Try using this gsub/regex combo on the Description data pill:

[description].gsub(/[\r\n]+/, "\\n")