How to Restore a Single Attachment to an Issue
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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 say a user has accidentally deleted an important attachment from an issue, and you have a backup /data/attachments/
directory elsewhere. Since JIRA 4.2, there were Changes to Attachment Creation so that JIRA now saves the attachment using an attachment ID instead of the attachment file name.
Restoring a Single Attachment
In order to restore the single attachment you need the following:
- A backup of
/data/attachments/
directory - The file type of the attachment that is accidentally deleted
Resolution
- Go to the backup
/data/attachments/
directory - Open 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.
- (Assume the deleted attachment ID is
667980
) Copy the file667980
to a temp directory - 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 referring to Attaching a File to an Issue