โ06-05-2024 06:22 AM
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?
โ06-05-2024 08:41 AM
Try using this gsub/regex combo on the Description data pill:
[description].gsub(/[\r\n]+/, "\\n")