PCJ-Custom field context that applies only to some issue types

Problem

Sometimes data import will fail with a message like this:

The custom field 'XXXX' in the backup project is used by issue types 'AAAA, BBBB' but the field with 
the same name in the current JIRA instance is not available to those issue types in this project.

Solution

You get this error even though the custom field is actually applicable for those issue types at the destination instance. This is a result of the JRASERVER-28006 bug. As described in that page, the workaround for this issue means making the custom field available for all issue types. So follow these steps for fixing it:

  1. At the destination, instance make sure that the field is available for all issue types. See Configuring a Custom Field for more information.
  2. Repeat the import. Make sure to select "Custom fields" as entities to be ignored in the configuration import. Otherwise, the app will reapply the configuration to custom fields as it comes from the source, undoing your manual adjustment in step 1.
  3. After a successful data import, you could restore those custom fields to their original configuration (restricted to some issue types) if that is the way you want them to be. Bear in mind, you could also achieve this restoration exporting "configuration only" from the source instance and importing that configuration into the destination. Of course, in this case, do not skip the import of custom fields.