Posts

Continuous cleanup for Jira. Part 1.

  Hi!    After reading  this article , I have tried to implement automation scripts for my Jira instance. Today, I would like to share a few scripts related to clean up inactive users references to issue properties, group, role membership.      Disclaimer,   as usual, everything should be tested in the test-environment first. Also, I'll be happy if you share or provide advice for the related small scripts. All scripts were tested and executed on Jira 7 Server releases (7.2.1, 7.6.3, 7.6.10). Well, you can use for execute groovy on Jira one of these apps (add-ons) -  Scriptrunner for Jira (commercial)  ,  MyGroovy (Opensource BSD-2)  ,  Groovioli (Opensource BSD-2) Well, let's next step is cleanup our Jira instance. 1. Let's remove memberships from group and project role for inactive users. (This script has been adopted for Jira 7 from Jamie Echlin answer from answer.atlassian.com) import com.atlassian.j...

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: ...

How to clean programmatically old drafts and purge trash with python for Confluence?

Image
  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...