Importing projects is the default functionality in JIRA. And 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 field's project importable, or in simple words, inform JIRA that our fields are okay to be imported!
To tag our custom field as project-importable, we need to implement the following interface:
com.atlassian.jira.imports.project.customfield.ProjectImportableCustomField
You will have to then implement the following method:
ProjectCustomFieldImporter getProjectImporter();
There are existing implementations for the ProjectCustomFieldImporter
class, such as the SelectCustomFieldImporter
class, which we can reuse. It is in this class that we check whether the value getting imported is a valid value or not.
For example, in the case of a select
field, we need to make sure that the value being imported is a valid option configured in the custom...