Posts

Showing posts from November, 2018

Confluence: How to programmatically clean versions of page with python for Confluence?

Image
  Hi   Atlassian community ,  It is one of the steps  from my routine work for Confluence administration for internal and customer facings installations as well.  Also, previous articles you can find here  1 ,  2 .   For continuous cleanup,  I use  atlassian-python-api  and  Atlassian Bamboo . Also, it is very easy to automate it and extend functionality. My use case was cleaning after a lot of programmatically created and updated pages after long time using. e.g. After cleanup, your page load metrics will be better, also, disk usage of Lucene indexes and DB usage.   Well, let's start.  1. Remove page version based on 2 different methods for Cloud and on-Premises releases: def remove_content_history(self, page_id, version_number): """ Remove content history. It works as experimental method :param page_id: :param version_number: version number :return: """ url = "rest/experimental/content/