How to Restore a Single Attachment to an Issue

Still need help?

The Atlassian Community is here for you.

Ask the community

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

  1. Go to the backup /data/attachments/ directory
  2. Open the attachments directory down to the folder of the issue key (Eg. /data/attachments/DEMO/DEMO-1/)
  3. 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

    (info) 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.

  4. (Assume the deleted attachment ID is 667980) Copy the file 667980 to a temp directory 
  5. Rename the copied file 667980 to 667980.png (Assuming the attachment that was deleted is a PNG file type)
  6. Upload the file 667980.png to the issue referring to Attaching a File to an Issue

Last modified on Sep 5, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.