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/ directory

  • The file type of the attachment that was 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

    ℹ️ 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. Copy the file 667980 to a temp directory (Assuming the deleted attachment ID is 667980)

  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 by referring to Attaching a File to an Issue

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.