Making the custom field project importable

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!

How to do it...

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 field on the target system. It is entirely up to the users to implement the various rules at this stage.

See the Javadocs at http://docs.atlassian.com/jira/latest/com/atlassian/jira/imports/project/customfield/ProjectCustomFieldImporter.html for more details on doing custom ProjectCustomFieldImporter implementations.

See also

  • The Making custom fields sortable recipe in this chapter
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.104.5