How to delete Jira Issues by age

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

0 votes
Answer accepted
Bhushan Nagaraj
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.
December 10, 2014

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 10, 2014

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.

0 votes
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.
December 10, 2014

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