Making the custom field project importable
Up to JIRA 3.13, individual projects can be imported from an existing JIRA backup file. More information on this can be found at https://confluence.atlassian.com/display/JIRA/Restoring+a+Project+from+Backup.
While importing projects, JIRA lets you copy all the issue data across, but only if it is asked to do so! Let us see how we can make the custom fields project importable, or in simple terms, inform JIRA that our fields are okay to be imported!
How to do it…
All we need to do to tag our custom field project as importable is implement the following interface:
com.atlassian.jira.imports.project.customfield.ProjectImportableCustomField.
You will have to then implement the following method:
ProjectCustomFieldImporter getProjectImporter();
Implementations already exist for the ProjectCustomFieldImporter
class like the SelectCustomFieldImporter
class, which we can re-use. It is in this class that we check whether the value getting imported is valid or not...