How to automatically add HTML content to Confluence

In our CD pipeline which we have implemented using JIRA and Bamboo, we have an "automatic release notes generator" that generates the release notes for us in the working directory of the build on the bamboo server. We are looking to integrate this with Confluence.

Our requirement is to update these auto generated release notes in our Confluence instance automatically. The key here is that the content that is auto generated is in HTML format.

We are not sure what is the best solution to get this HTML content into Confluence. Please help!

3 answers

1 accepted

You can use CLI task from Run CLI Actions in Bamboo to run the storePage action from Confluence CLI to create the page. If the data is HTML, I would recommend you wrap the HTML content in the html macro on your Confluence installation. Here is an example of the action you would use. The page content is constructed from the content parameter followed by the file contents followed by the value of the content2 parameter:

--action storePage --space XXX --title "My page title" --file page.html --content "{html}" --content2 "{html}"

Bob: Thanks for responding.

Your CLI certainly looks very promising and we definitely want to consider it for purchase. 

In the above example I notice that you are passing "page.html" as one argument. But what if my HTML content is not merely one page. And there are other artifacts involved such as PNGs, javascript, etc. See below for example. Any help on how that can be handled ?

Sample documentation HTML.jpg

You might want to just "serve" those pages directly using Confluence's Tomcat and simply put a single page in Confluence (perhaps the index???) in order to make it appear to be in Confluence and once they click on link it will just serve the regular HTML page. This would more easily retain the formatting of the generated stuff especially if it is more complex. I have done that with java doc like material in the (distant) past.

Thats an interesting idea. Let me try it out.


Hi Bob. Which of these should I use?


image2016-1-21 13:45:31.png

Confluence Command Line Interface is what you need for your use case. It installs on your Confluence server and then you install a client - either the Confluence specific client or the more general Atlassian CLI client that includes all the other clients. There is no charge for clients, just the server piece is licensed.

Just to clarify - the HTML content is not merely an HTML page, but includes stylesheets, PNGs, and angular JS

0 votes
Steven Behnke Community Champion Jan 20, 2016

If you're attempting to display full HTML documents in Confluence, you may want to display pages in confluence that are rendering your documents –

You could use Bob Swifts CLI to programmatically create the pages as well.


Thanks for responding.

I tried to use the HTML include macro. And the HTML page was not rendered fully. Only some text from the top showed up. So not sure how to proceed. 

Also - the HTML page that can be included - does it always have to sit behind a web server.

For example - if I have an HTML page that goes like this –

and I use that in the HTML include macro

this is what I get "Error rendering macro 'html-include' : null"


Steven Behnke Community Champion Jan 21, 2016

Interesting. I've used it to display hosted pages, so I've never run into this issue like this.

If you'd still like to display content in a page, I'd probably instead create an iframe user macro and then load the content in to the iframe. That's really the effect you're trying to achieve anyway.

Seems like Bob's got a good handle on the basics of your question, the question of how to display other web content in Confluence is interesting. Again, an iframe is the effect you're looking for seemingly, is this something you could persue? Are you on Cloud or hosted? Are you an administrator?

Yes. One of my responsibilities is to take care of all our DevOps tools and processes and related requirements. So in a way, I am an admin. Let me do some research on iframes as well. (We are on our own cloud by the way)

Steven Behnke Community Champion Jan 21, 2016

Well sure, you could use the HTML Include macro so you have access to Usermacros, duh.

You could enter the iframe into the HTML macro, like so – 

<iframe src="" noborder="0" width="830" height="800" scrolling="yes" seamless></iframe>


A usermacro would further simplify this.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

732 views 2 13
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you