3 min read

Instantly archive thousands of Jira issues with ScriptRunner and JQL

EL
Eran Levy
Tue, 31 Mar 2020 Jira
Instantly archive thousands of Jira issues with ScriptRunner and JQL

Instantly archive thousands of Jira issues with ScriptRunner and JQL

In larger deployments of Jira Data Center, issue archiving can become… an issue, especially when the number of open tickets that need archiving reaches the tens of thousands. Jira limits the amount of issues you can archive to 1000 and does not provide an automated way of archiving issues at scale across multiple projects; over time, this becomes one of the most annoying aspects of a Jira Admin’s job, and clutters the Jira instance with ancient and irrelevant content. 

The Issue Archiving Job, a newly released feature in ScriptRunner for Jira, lets you easily solve this problem by periodically and automatically archiving issues based on a JQL query. Watch the video below for a quick overview, or read on for the details:


Video: scheduled issue archiving at scale

The challenge: manual and time-consuming process for archiving

While issue archiving is meant to be done regularly as part of regular project upkeep, it’s not uncommon for thousands of issues to be generated and left open for weeks and months - either in the course of operations, or due to human errors and software bugs.

While you can use JQL to identify older issues and archive them, this can be a manual and time-consuming process due to some limitations that Jira has out of the box:

  • Jira only allows you to archive 1000 issues at a time, requiring a repetitive and tedious process when dealing with tens or hundreds of thousands of open issues.
  • Archiving needs to be done on a per-project basis, adding an additional step when cleaning up an entire instance.
  • There is no way to automate this process, e.g. by scheduling it to run periodically.

This means Jira admins need to run the JQL query to identify the issues that need archiving, and then spend time sifting through screen after screen in order to delete issues in batches. Clearly this is not time well-spent, and distracts from other mission-critical tasks. Without a way of automating the process, it can clearly get forgotten, leading to messy and cluttered Jira deployments.

The solution: automatic issue archiving

Using ScriptRunner, we can automate this problem away. Issue Archiving is a built-in function that can be run as a scheduled Job in ScriptRunner without writing any code.

To use Issue Archiving, all you need to do is define a JQL query (which you can modify using ScriptRunner’s enhanced search capabilities), and then schedule your job to run. At that time, ScriptRunner will crawl through your Jira instance, detect the issues based on the logic you defined - e.g., duplicate issues older than 365 days - and archive them. There are no limits to the amount of issues you can archive, and it only takes a few clicks.

Issue Archiving Job for Atlassian

In just a few clicks, you can now automate the process of archiving thousands of historical issues in one fell swoop - eliminating hours of manual work and a ton of hassle.

To make this process even simpler and easier, you can use this script from the Adaptavist library: Archive Projects with no Recent Updates. Simply copy and paste it into ScriptRunner to instantly get a leaner and meaner Jira instance.

Ready to get started?

Stop worrying about repetitive tasks and work smarter with Jira automation. Start your free trial of ScriptRunner for Jira Data Center now by visiting the Atlassian Marketplace.

Atlassian Marketplace


Stay up to date by signing up for monthly Adaptanews