Confluence page modification

Hi All,

I have recently migrated contents from Trac wiki to Confluence, We have nearly 1400 pages under this space.

I wanted to automate the Pages by adding TOC macro on top of each page, seach for code section within page and insert Code block macro and inside it the code should be pasted.

Can anyone please hep me how can i move ahead with this.. I am looking for some kind of python script to start but wondering the point to get kick start.

Thank You,

Akash

1 answer

This widget could not be displayed.
Davin Studer Community Champion Aug 03, 2014

I have a couple suggestions. One would be the Confluence Command Line Interafce. There are some handy methods in it such as find and replace that you could automate across you instance. It uses Atlassian's API to do the changes, so you know it should be a safe operations.

Another possibility would be to use the WebDAV plugin(installed by default in Confluence). You can map Confluence to a drive letter(at least you can on Windows) and then work with it as if it were just a file system. Each page has a directory with the same name as the page and inside the directory is a .txt file with the mask {page name}.txt. The .txt files have the actual page content, so it you are into scripting it you could do it that way.

Hi Davin,

Thanks, i am working on your suggestions. Hope it does a trick for me.

Hi Davin,

I have tried using CLI but there issues in communicating with Confluence instance, I even wonder even if it works for me to making bulk modification on every page as each page need to be traced and look for Heading levels based on heading level an TOC macro should be inserted, trace whole page and look for code block and insert that code into Code block macr.

Can you please let me know if there could be any other option like writing script to do these modifications, such as XML RPC, I ahve gone with these and found few method likes storePage, updatePage, but none matching my requirements.

Thank You,

Akash

Davin Studer Community Champion Aug 11, 2014

I also mentioned the WebDAV plugin. You could for instance map Confluence to a drive letter and then just use you native filesystem APIs in python to edit the pages.

There is also the SOAP API and the RSET API that you might check into. If it is a one time thing though I would just get the WebDAV stuff setup. You could have it mapped to a drive in under five minutes. Then just script against it as if it were files and folders.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

485 views 6 6
Join discussion

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