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

Accepted Answer
0 votes

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 Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

24,345 views 2 7
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