Hi Jira Community,
I'm integrating Adobe Workfront with Jira Cloud using the REST API v3 (/rest/api/3/issue) and running into an issue when creating Spaces and Tasks with descriptions (Description field) that contain line breaks/newlines.
What works:
What fails:
Current approach: I'm using the Atlassian Document Format (ADF) structure:
"description": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "{{description}}" } ] } ]}The problem: When {{description}} contains text with line breaks (e.g., from a multi-paragraph field in Workfront), the JSON fails to parse.
What I've tried:
stripHTML() functionsQuestions:
Any guidance would be greatly appreciated!
Thanks!
Nick
PS - I'm not a developer, but have been learning.
Hi @Nick
Yes, and...to the suggestions from @Andy Rusnak
Did you ensure the message was encoded so the line breaks / newlines send correctly? I am not familiar with Adobe Workfront, but perhaps there is a function to do that encoding.
If the endpoint is called from an Atlassian Automation rule, that would be the jsonEncode function.
Kind regards,
Bill
Hi Nick,
I hope this post finds you well! I hope your journey into development work has been enjoyable thus far too!
I ran a quick test with the description field containing new line characters and didn't have any issues related to this. This was a sample of what I used for the field:
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Hello there\nfrom a new line"
}
]
}
]
}
Is that similar to how yours is formatted? Would you be willing to share an actual sample of the request that fails?
The JSON parser is also pretty strict, so if you have a comma for example after the last line it will also throw an error like that.
Best,
Andy
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.