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:
json
<span>"description": {</span><span> "type": "doc",</span><span> "version": 1,</span><span> "content": [</span><span> {</span><span> "type": "paragraph",</span><span> "content": [</span><span> {</span><span> "type": "text",</span><span> "text": "Lorem Ipsum text with ~ / % & @ # ' ' \" ; characters"</span><span> }</span><span> ]</span><span> }</span><span> ]</span><span>}</span>What I've tried:
- Escaping double quotes:
\" → \" - Escaping backslashes:
\ → \\ - Replacing special characters with alternatives
- Using
escapeHTML() functions before sending - Replacing newlines with
\n or spaces
Question: 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