How to clean programmatically old drafts and purge trash with python for Confluence?
Hello! In this article, we will learn how to maintenance with python and Confluence REST API and set script into your CI e.g. Atlassian Bamboo . Also, it is very easy to automate it and extend functionality. Nowadays, so many Confluence instances have enabled function collaborative editing or long time did not maintenance. For example, in our instance, DB backup in text format has been decreased by ~ 16%. Let’s start with trash cleaner functionality. Algorithm is easy, like get all pages from trash, remove related pages. And REST API reference located here e.g. https://docs.atlassian.com/ConfluenceServer/rest/6.11.0/ Next thing is easy for implement language, it is python with module requests. For more comfortable use raw Rest API I’m using python module with name atlassian-python-api . Hence code is so small and easy. def clean_pages_from_space(confluence, space_key): """ Remove all pages from trash for related space :param conflue...