Is there a specific safe way to delete JIRA issues by age? Should this task be run via CLI or directly from the MySQL database? Can the command be more granular by deleting JIRA tickets age and status type? Also, is there a command I can run to preview the tickets to by deleted by age before I execute the delete?

2 answers

1 accepted

Hi David,

Deleting the issues just on the jiraissue table on the database, will not delete all the related custom fields, etc and is not recommended.

You can run a JQL and bulk delete issues if you would like to do it within JIRA. This will also allow you to check the list of issues you are deleting.

If you are using CLI, you will have to run two commands, first to select the issues and check if the issues are the ones you want to delete, and second to delete the issues.

To add my 2p - don't even think about doing it with SQL, it's messy, complex and you have to understand all of the relationships in intimate detail to get it right. For a single issue, you may have to delete from and/or update up to 36 tables (and that's an old version of JIRA, it's probably more now) For both bulk-edit and the CLI, I'd define a filter (as complex as you'd like - status, date, project, inside leg measurement, any variable you want) and go from there.

You need to construct the JQL to select the issues you want. I assume by age to be something based on either created date or updated date or similar. Once you have the JQL, the you can use getIssueList to see the list and runFromIssueList to remove them.

If you need to manually inspect the list, then bulk delete would be my choice. If you want to automate it, then spend the time to get the JQL right and use the CLI to do it by scheduling it in a job scheduler or Bamboo.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,241 views 14 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot