I need to bulk delete issues in Jira

James Murphy October 18, 2012

Hello,

I need a way to bulk delete a certain type of issue in Jira. I've found a way to buld delete up to 1000 messages at a time but there are WAY too many screens to go through each time and I can't spend all day on this. Is is possible to do a query and delete every result? I have 53,000 issues I need out of my jira database.

Please help.

Thanks

5 answers

3 votes
brianashe June 5, 2017

There's an easy answer if you want to delete a sequential series of issues, eg. issues ABC-1 to ABC-5000.

First, you can use `curl` (in Mac OS terminal or Linux or similar) with the API to delete individual issues by key:

curl -u yourname:yourPassw0rd -X "DELETE" http://jira.example.com/rest/api/2/issue/ABC-1

The API URL alone will give you the issue when used with 'GET' but adding `-X "DELETE"` will change the request method from GET to DELETE and the server will delete the issue.

For deleting many issues, `curl` has a built-in option that lets you specify a range of numbers so you can do something like this:

curl -u yourname:yourPassw0rd -X "DELETE" http://jira.example.com/rest/api/2/issue/ABC-[1-5000]

... and then just let that run for a while.

If you need to delete issues at random, first you'll need to get a list of issue numbers, then write a script to run the one-issue command once for each issue.

This is really handy when you're testing options to bulk-import issues and you need to delete a few thousand things you just created. :-)

(I assume James solved his problem in the last 5 years but maybe someone else will find this useful. )

brianashe July 18, 2019

Note that this will result in one notification being sent for each deleted issue. You might want to go to the project's Notification Settings page and temporarily remove everyone from the "Issue Deleted" event.

3 votes
Harry Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2012

Hi, have you tried doing bulk delete https://confluence.atlassian.com/display/JIRA/Modifying+Multiple+('Bulk')+Issues?

You can perform a search on the issues you want and using the bulk operation to delete all the issues. Does this work for you?

Otherwise you might like to look at JIRA CLI https://bobswift.atlassian.net/wiki/display/JCLI/JIRA+Command+Line+Interface - Bob would probably provide more help with this.

James Murphy October 18, 2012

I tried the bulk edit function but it only lets you do 1000 at a time and I have 53000 to delete. Furthermore it doesn't work. Ever time I hit the confirm button it hangs for several seconds then I get a message that Jira is down for maintenance. I'm hoping somebody at Atlassin can help me out or I guess I'll have to figure out the command line interface.

Thanks

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2012

Expanding on Harry's answer - runFromIssueList with the JQL to select the right issues and then deleteIssue as the action that is run for each issue found in your query - see How to use runFromIssueList

Jeremiah Landi January 13, 2016

As an fyi, the link doesn't work anymore. It is now: https://confluence.atlassian.com/jira/managing-global-permissions-185729559.html

Like Vuyani Moyo likes this
QZhang April 1, 2020

Delete multiple issues

This bulk operation allows you to delete multiple issues at the same time.

Collapse

  1. Perform a search with the required filters to produce a list of issues.
  2. Select Tools > Bulk Change.
  3. Select the issues you'd like to perform the bulk operation on, and select Next.
  4. Select Delete Issues, and select Next.
  5. If available, decide whether you'd like to send email notifications. Select Next.
  6. Review your bulk operation, and select Confirm when you are happy with the operation.
Like Vuyani Moyo likes this
2 votes
Dave F June 2, 2019

I suggest searching the Jira marketplace for a "delete" add-on/plug-in/app.

For v8 I've just used Mass Delete for JIRA. It is currently chewing through the tens of thousands of issues I need deleted. It was very simple to use, basing it's deletion off a JQL query.

It did generate a lot of email spam. Next time I will do this out of hours with notifications disabled while it deletes.

Depending on when you read this the app may have a replacement or competitor. 

0 votes
Jit February 7, 2020

Hello,

I used this add on <

Mass Delete for Jira in Jira cloud. It saved me. They have a server version too 

It is very simple to use. 

https://marketplace.atlassian.com/apps/1215042/mass-delete-for-jira?hosting=cloud&tab=overview

Jit February 7, 2020

I forgot to mention. Please make sure to Disable Delete Issue Notification from the Project Notification setting. I deleted 50,000 issues in 5 hours. 

0 votes
Jan Szczyra February 27, 2017

Hello,

You can also use jira-python that you install with `pip install jira`

http://jira.readthedocs.io

Then I wrote such a super simple script:

#!/usr/bin/python
# This script shows how to use the client in anonymous mode
# against jira.atlassian.com.
from jira import JIRA
import re

jira = JIRA(basic_auth=('admin', 'admin'),server=('http://jira.domain.net:8080'))

issues = issues = jira.search_issues('reporter="Default"')
for issue in issues:
  print "%s" % issue
  issue.delete()

Of course you can search issues with different fields (status, priority etc.)

Suggest an answer

Log in or Sign up to answer