This question sums up my problem well:
And here is my code:
def _format_page(issue, comments):
issue_body = markdown.markdown(_format_issue(issue))
issue_body = utils._replace_code(issue_body)
comment_body = _format_comments(comments)
print(issue_body)
json = {"type": "page",
"title": issue['key'] + ": " + issue['fields']['summary'],
"space": {"key": creds.confl_space},
"body": { "storage": {
"value": issue_body + comment_body,
"representation": "storage",
}
}
}
return json
Above is the code I'm using. Everything works and posts a page on Confluence, except the {code} ... {code} blocks appear in plain text. My goal was to convert a Markdown file to HTML and then post the snippet onto the page. The format is in storage, like the answerer said to do, so what am I doing wrong? Thank you.
Edit: Just to be clear, I am transferring Jira Issues to Confluence pages. This just formats the JSON file - it does not perform any CRUD requests.
Dear @Sabrina Reyes ,
I recommend to create a sample page with a code block, read the page with an API call and see how it should look like. Eventually you have to convert the read issue data to fit to the confluence json format.
So long
Thomas
Dear @Sabrina Reyes ,
was my answer useful? Then I would be happy when you click on the "green accept answer" button.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Thomas Deiler
I did resolve this issue without viewing this answer, but I did the method without having looked at it, so it did help!
I realized my answer had to do with Confluence accepting pure text HTML over markup text.
Be well,
Sabrina
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.