How to restore a deleted custom field in Jira
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
This article will cover the steps to take to recover any custom field data that has been accidentally deleted. You will need to either stand up an intermediary instance or utilize an existing lower environment to restore the data to.
You will need either a full DataBase backup that contains the custom field data or a full XML backup that contains the deleted custom field data.
This article is applicable to all versions of Jira 7.x and 8.x, and Service Management 3.x and 4.x.
1) Create a new instance of Jira
You'll need to restore either the database backup or an XML backup of the data taken before the custom field data was deleted, we also recommend following the guidelines of Creating a test environment for Jira when performing the restore. Once the data has been fully restored we can move on to data validation. From here on out we'll call this server the source. We'll refer to the instance of Jira that had the custom field deleted as the target.
2) Create a new custom field on the target with the same name as the deleted field.
You can use the source instance as a guide making sure to create the correct context, etc. This is a very important step as we'll need this to exist so we can map the values later on.
3) Find the issues that have the custom field populated.
- Log in to the source server.
Perform a JQL search for all issues that have the custom field that was deleted populated:
<name of custom field> is not empty
4) Export the results to a CSV.
You'll only need the following fields:
- issue key
- custom field that was deleted from the target
Since we're going to be doing a CSV import to the target instance and updating the existing issues with the custom field data from the source instance, we'll only need these three fields.
5) Sort and break up the CSV by issue key.
This will allow easy import into the target instance since we'll be importing by the project. So if we have 5 projects in total we'll want to break this into 5 different CSV files for import.
We've broken this up by project in the name of ease of use, you can define the projects in the CSV without splitting them up, see the following Importing data from CSV for more information.
6) Perform a CSV import into the target instance.
- Navigate to the external import page in Jira.
- Select CSV.
- Browse to the CSV file we exported from the source instance.
- Select the project to import the values into.
- Map the following fields:
- Select Begin Import.
- Repeat the process for each project.
After this process is done the custom field values should be updated in the issues defined in the CSV.