Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-44379

Remote Issue Copy throws NullPointerException if an unmapped custom field is required at the destination

    XMLWordPrintable

Details

    Description

      Summary

      When using the Remote Issue Copy plugin to copy an issue between two application linked JIRA instances, if there is a custom field type which the Remote Issue Copy can't map, and there is a custom field in the destination JIRA which is required in the Field Configuration for the project the issue is being moved to, then a NullPointerException is thrown.

      Steps to Reproduce

      1. Link two JIRAs via application links
      2. Install Remote Issue Copy plugin on both sides
      3. Ensure that there is some custom field provided by a third-party addon which is required on the field configuration of the project you want to copy the issue into
      4. Use remote copy to copy an issue into the project with the required third-party addon custom field

      Expected Results

      An error message is displayed noting that the custom field type is not supported by the Remote Issue Copy plugin, and there is a required field in the destination of that type.

      Actual Results

      An error displays in the browser, one of:

      • Error occured when remote JIRA instance was processing request
      • Remote copy couldn't communicate with remote JIRA instance.

      The second error is actually a generic error meaning that the remote side didn't respond before the UI timed out.

      The below exception is thrown in the atlassian-jira.log file:

      2015-07-20 15:38:33,865 http-bio-10634-exec-8 ERROR <username> 937x217x1 znrwnc 172.22.200.130 /rest/copyissue/1.0/copyissue/fieldPermissions [atlassian.cpji.rest.CopyIssueResource] Failed to check field permissions for source issue 'ISSUE-1
      java.lang.NullPointerException
      	at com.atlassian.cpji.fields.permission.CustomFieldMappingChecker.getFieldPermission(CustomFieldMappingChecker.java:112)
      	at com.atlassian.cpji.components.CopyIssueService.checkFieldPermissions(CopyIssueService.java:252)
      	at com.atlassian.cpji.rest.CopyIssueResource.checkFieldPermissions(CopyIssueResource.java:59)
      ...etc...
      

      Workaround

      1. Make it so that affected custom fields are marked optional on the field configuration of the destination JIRA/Project.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmason David Mason (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: