Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Posting HTML on Confluence using Python

Hung Tu I'm New Here Jun 02, 2022

I am on Confluence server and I am trying to post a Dynamic HTML file onto Confluence through python script. I know this HTML works because it shows up when being posted using editor with the default HTML macro.

However, I need to automate this process therefore I am using Python Script. So far I was able to use the Python REST API library to create a page and post simple HTMLs. I got the HTML macro to work as well using this storage format:

"""<ac:structured-macro ac:name="html"><ac:plain-text-body><![CDATA[ {the HTML} ]]></ac:plain-text-body></ac:structured-macro>"""
But when I go to post the this dynamic HTML that has JS and CSS, nothing shows up. When I open the editor of this page, the correct content inside HTML macro is there. This is strange for me and I am not sure where to go from here. Any help is appreciated! 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

1,019 views 17 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you