Hi Jira Community,
I'm new to coding, but have worked on using iPasS platforms to automate and integrate systems. I'm also somewhat new to Jira.
I'm creating Jira tasks via the REST API v3 (/rest/api/3/issue) using Atlassian Document Format (ADF) for descriptions. Task creation works fine for most content, but fails with a JSON parsing error when the description contains certain special characters.
Working example: Simple text descriptions create successfully.
Failing example: Descriptions containing these special characters cause 400 errors: ~ / % & @ # ' ' " ;
Current ADF structure:
"description": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "Lorem Ipsum text with ~ / % & @ # ' ' \" ; characters" } ] } ]}What I've tried:
\" → \"\ → \\escapeHTML() functions before sending\n or spacesQuestion: What's the proper way to sanitize or encode text content with special characters for ADF text nodes? Is there a recommended encoding method or list of characters that must be escaped/removed?
Any guidance appreciated!
Thanks,
Nick
Hi @Nick
there is an easy fix for that. You can simply use the jsonEncode() function. It will escape the content as needed.
You could also put your content from the description into a variable (declared before the post) and then go with
{{variableName.jsonEncode()}}
in your webrequest action.
Please checkout https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonEncode-- for further information.
Thanks, @Kai Becker !
Turns out Adobe Workfront Fusion modules don't have the jsonEncode() function available. However, you did lead me down the correct path with regard to using Fusion's available encoding functions which ended up solving the issue.
Much appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.