There may be instances where we unintentionally or deliberately delete a Jira issue, and then realize that we need it later. Reversing a deleted Jira issue can be challenging since there is no built-in recovery option in Jira. Nevertheless, there are methods for retrieving deleted Jira issues. This blog post will provide you with instructions on how to recover deleted Jira issues.
Prerequisites
Before we start, it’s important to note that you need to be a Jira administrator to recover deleted issues. You should also have access to the database where Jira data is stored.
Recover Deleted Jira Issue – The Steps
Step 1: Identify the Deleted Issue
First, you need to know the key or ID of the deleted issue. This information can be obtained from the Jira log files. Look for a line similar to the one below:
Deleting issue: [IssueImpl@XXXXXX[id=XXXXX…]
Step 2: Access the Database
Since deleted issues are not available in Jira’s interface, you will need to access the database to retrieve the deleted issue. Access your database and execute the following command:
SELECT * FROM jiraissue WHERE ID = 'the issue id';
Make sure to replace ‘the issue id’ with the actual id of the deleted issue.
Step 3: Recover the Deleted Issue
If the above command returns a result, it means the issue is available in the database. To recover the issue, execute the following command:
UPDATE jiraissue SET pkey = 'new issue key' WHERE ID = 'the issue id';
Replace ‘new issue key’ with a unique key for the issue and ‘the issue id’ with the actual id of the deleted issue.
Conclusion
And there you have it! By following the steps above, you can recover a deleted issue in Jira. Remember, deleting an issue in Jira should be the last resort; always consider using the ‘Hide’ or ‘Disable’ options instead of deleting. Happy Jira management!