Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete issue by keeping attachments on file system

Mitali
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2019
As it’s mentioned in documentation, deleting issue will delete the attachments. But is there any way to keep the attachments on file system as it is and just delete the issue from database using Java API?

2 answers

1 vote
Joe Pitt
Community Champion
January 29, 2019

Do not delete issues. When you delete it is GONE. Hardly a week goes by without someone wanting to restore an issue. Deleting issues will come back and bite you when it is the most inconvenient. I suggest closing with a resolution value of Deleted anything you want to delete. I implement a special transition only the project lead can execute and it requires filling in a reason field from a select list (such as entered in error, OBE, Duplicate, Other) and explanation text.

Deleting issues destroys historical data. Missing issue numbers will eventually cause a question about what it was and why was it deleted even if it was done properly. Missing data always brings in the question of people hiding something that may have looked bad.

 

The only viable way to restore an issue is to create a new instance of JIRA and restore a backup that has the issues. Then export them to a csv file and import them to your production instance. You will lose the history.

DO NOT modify the database directly

0 votes
Nic Brough -Adaptavist-
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.
January 29, 2019

No.  If an issue is deleted, you need to remove the attachments for it too.

The Jira attachment store is for Jira attachments only.  While it's technically possible to read from it (and update in some cases), that is the wrong thing to do.  The only good reason to read a Jira attachment directory directly is "getting a backup".

If you want to keep attachments from Jira issues you are deleting, download them properly and keep them somewhere safe, do not mess with the attachment storage.

So:

  • If you want to keep attachments from Jira issues you are deleting, download them properly and keep them somewhere safe, do not mess with the attachment storage.
  • If you are going to delete issues, do it with the API, don't even think about the database
  • Think very carefully before deleting any issues - delete means "gone", totally.  Limit the right to the minimum people (ideally just admins, and don't enable it by default, they'll be able to do it when they need to).  One mistaken delete and you can spend weeks in purgatory trying to "recover" a lost issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events