I need to bulk delete issues in Jira

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

3 answers

This widget could not be displayed.

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.

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

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

This widget could not be displayed.

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

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

70 views 2 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you