Bulk delete issues in Jira Data Center
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Delete / Purge a high amount of issues in Jira
If you are looking to Archive issues instead of deleting them, please refer to these other KBs below:
Jira Data Center: Archiving an issue in Jira Data Center
Environment
Jira Data Center
Diagnosis
Jira does not offer and does not recommend a SQL query to delete old issues directly from the database. This would be potentially dangerous to the integrity of your Jira data due to all of the associations needing to be handled.
In order to proceed with this, we are assuming that you are looking for permanently remove issues from Jira which is no longer required. Please be aware to make a backup of your database before this, since you won't be able to recover these issues once deleted, but only by restoring your database in another instance.
Cause
The reason for mass deleting issue in Jira could vary from improving the performance of the instance to decreasing the number of issues on the instance, or simply getting rid of old / obsoletes issues which is no longer required.
Solution
The solutions below would be the some ways to purge a mass amount of issues from Jira. From Jira UI you can use the Bulk operation feature to remove several issues at once, but it has a 1000 issue limit on the number of issues that can be modified in bulk, although you do have the option to increase the limit, Jira was not designed to handle that in one job, so you would probably need to try the other ways through a REST API or from a plugin in case you need this procedure to be faster.
1. From Jira UI
This bulk operation allows you to delete multiple issues at the same time. To delete multiple issues:
Perform a search with the required filters to produce a list of issues.
Select Tools > Bulk Change.
Select the issues you'd like to perform the bulk operation on, and select Next.
Select Delete Issues and then select Next.
If available, decide whether you'd like to send email notifications. Select Next.
Review your bulk operation, and select Confirm when you are happy with the operation.
Obs: By default, Jira has a 1000 issue limit on the number of issues that can be modified in bulk. The bulk edit limits are in place to prevent issues with system stability. Please increase this amount slowly and test frequently to avoid system stability issues. To increase the limit check: Increase the number of issues that can be bulk edited in Jira
2. Using REST API
You can build a script that will run this REST API to delete multiple issues all at once:
You can run this through either the command line or some REST API client tool, like Postman:
For both methods the bulk delete is performed by a single thread. Jira is looping over single issue deletes in one thread rather than being a parallel multi-thread operation. This is intentional to not affect performance of the rest of the instance. For this reason, having more CPUs will not affect this operation. If you are deleting a very large number of issues with a lot of associations, it is advisable to take that time required into account.
Deleting issues issues in bulk directly in the database may seem like a faster method, but would actually be the opposite and would be potentially dangerous to the integrity of the Jira database. The deletion of an issue involves a lot of steps to ensure that all its associations are properly handled. Doing those manually for a large number of issues would take a significant amount of time and is error prone. In addition, the issues would then still remain in the search index until a re-indexing is performed.
3. Plugin
Mass Delete for Jira makes the removal of large numbers of Jira issues easy. Unlike the bulk delete functionality provided by Jira, this add-on has no limit on the number of issues removed by one job. Provide a query, and Mass Delete simply removes all of the matched issues. Of course, the process may take a substantial amount of time, depending on the number of issues. Mass Delete for Jira provides a real-time progress monitor which can also be used to terminate a running job if necessary.
Was this helpful?