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

Performing an External System Import from a CSV file fails when creating new custom fields

XMLWordPrintable

      Issue Summary

      This is reproducible on Data Center: yes

      When performing an External System Import from a CSV file, if the user chooses to create new custom fields during the Map fields step they receive an XSRF error when moving to the next step.

      The user is allowed to proceed if they select Retry operation, but the import will subsequently fail with the errors Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state and java.lang.IllegalArgumentException: Can not construct an ExternalCustomField with null arguments.

      Steps to Reproduce

      1. Set up a Jira 9.x test environment.
      2. Create a test project.
      3. Navigate to Administration (⚙) > System > External System Import, choose CSV and import the attached CSV file test.csv, targeting the test project created in step 2.
      4. In the Map fields step, for Custom field (Test Custom Field), choose New Custom Field and enter Field Name as Test Custom Field and Field Type as Text Field (single line), then select Submit. (The field type doesn't actually seem to matter, but the field data in test.csv was originally from a single-line text field.)
      5. Note that an XSRF Security Token Missing dialogue box appears. Select Retry Operation.
      6. Map Summary to Summary to allow us to proceed to the next step, then continue with the import.

      Expected Results

      The import should succeed.

      Actual Results

      The import will fail, displaying the error Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state in Jira's web interface.

      Jira will log the following error:

      2024-07-16 00:00:00,000+0000 JiraTaskExecutionThread-123 ERROR username 1234x5678x9 abc123 1.2.3.4 /secure/admin/ImporterLogsPage!import.jspa [c.a.j.p.i.i.i.impl.AbstractDataImporter$1Thread[https-jsse-nio-8443-exec-24 url: /jira/secure/admin/ImporterLogsPage!import.jspa; user: username,5,main]] Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state
      java.lang.IllegalArgumentException: Can not construct an ExternalCustomField with null arguments.
      at com.atlassian.jira.plugins.importer.external.beans.ExternalCustomField.<init>(ExternalCustomField.java:30)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.verifyCustomFieldOrCreate(DefaultJiraDataImporter.java:1203)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importExternalCustomFields(DefaultJiraDataImporter.java:1244)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:900)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:787)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:414)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)
      at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)
      

      If the import configuration was saved, reviewing it will show that Jira was attempting to create the new custom field with a null type, even though the Text Field (single line) field type was selected in the UI:

          "Custom field (Test Custom Field)" : {
            "new.custom.field.name" : "Test Custom Field",
            "new.custom.field.type" : null,
            "new.custom.field.searcher" : null
          }
      

      Workaround

      Enable the dark feature jira.webactions.request.method.dependent.xsrf.checks.disabled (see Preparing for Jira 9.0 for details regarding this dark feature).

        1. test.csv
          1.0 kB
          Marcus Fong

              Unassigned Unassigned
              8379abf86dad Marcus Fong
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: