How to Restore a Single Attachment to an Issue in Jira (Server and Data Center)
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Overview
This guide will explain on how to restore a single attachment to an issue. Let's say a user has accidentally deleted an important attachment from an issue. However, you do have a backup /data/attachments/
directory elsewhere.
Since JIRA 4.2, there were Changes to Attachment Creation so JIRA now saves the attachment using an attachment ID instead of the attachment file name.
Restoring a Single Attachment
To restore a single attachment you need the following:
A backup of
/data/attachments/
directoryThe file type of the attachment that was accidentally deleted
Resolution
Go to the backup
/data/attachments/
directoryOpen the attachments directory down to the folder of the issue key (Eg.
/data/attachments/DEMO/DEMO-1
/)Compare the IDs in the directory with the existing ID from an attachment URL in the JIRA issue. For example, the attachment ID below is
667983
http://your-jira/secure/attachment/667983/EditProjectRoles.png
ℹ️ Since you have deleted the attachment, it won't exist in the issue. However, you can refer to this step to identify the missing attachment ID with the attachments in the backup directory.
Copy the file
667980
to a temp directory (Assuming the deleted attachment ID is667980
)Rename the copied file
667980
to667980.png
(Assuming the attachment that was deleted is a PNG file type)Upload the file
667980.png
to the issue by referring to Attaching a File to an Issue
Was this helpful?