This is a weird one for y'all.
I am using an automation to create a Confluence page with content from a Jira issue. It basically dumps a bunch of fields from an incident, including the description from the incident ticket.
Attached is a screen shot of the description field on the source issue (Picture1).
When I send it through the Confluence rest API via Jira automation, it comes through with all the formatting stripped out and rendered in plain text (Picture2).
This happens whether I use .htmlEncode or .jsonEncode at the end of the {{issue.description}} smart value. I cannot send this unencoded because the line breaks in the description body result in JSON errors. (So does trying to use the ADF as the representation type, so please don't suggest that.)
What encoding should I use to get the description field to render in a Confluence page along with its formatting?
Picture1:
Picture2:
And because I know the #1 question will be "show us your automation!" here's the relevant part of the API call:
Hi @Stephanie Bryant -- Welcome to the Atlassian Community!
After some experimentation to confirm, I found .html rather than .htmlEncode gets the correct markup for passing to Confluence, and then follow that with jsonEncode for the Confluence update page endpoint:
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-put
For example, assuming my rule created the page and I saved the title in a variable the custom data could be this:
{
"id": "{{createdPage.id}}",
"status": "current",
"title": "{{varPageTitle}}",
"body": {
"representation": "storage",
"value": "{{issue.description.html.jsonEncode}}"
},
"version": {
"number": 2,
"message": "Adding some content"
}
}
Kind regards,
Bill
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.