Uploaded image for project: 'Jira Software Server and Data Center'
  1. Jira Software Server and Data Center
  2. JSWSERVER-13792

JSON File Example provided on JIRA 7 documentation is not compatible with JIRA 7.

    XMLWordPrintable

    Details

      Description

      Summary

      JSON File Example provided on JIRA 7 documentation is not compatible with JIRA 7.

      Steps to Reproduce

      Attempt to import a project using the JSON Source Example (Project Key and Issue Key) provided on Importing data from JSON documentation

      {
          "projects": [
              {
                  "name": "Sample data",
                  "key": "SAM",
                  "issues": [
                      {
                          "key" : "SAM-123",
                          "status" : "Open",
                          "reporter" : "admin",
                          "summary" : "Parent case",
                          "externalId": "123"
                      }
                  ]
              }
          ]
      }
      

      Expected Results

      To have the project created and imported properly.

      Actual Results

      The project is not imported since it's missing the project type, giving the error below:

      2016-06-10 15:08:07,044 INFO - ------------------------------
      2016-06-10 15:08:07,044 INFO - Importing: Users
      2016-06-10 15:08:07,044 INFO - ------------------------------
      2016-06-10 15:08:07,044 INFO - Only new items will be imported
      2016-06-10 15:08:07,044 INFO - 0 users associated with import. All of them imported as inactive, this can be changed after import in User Access step.
      2016-06-10 15:08:07,044 INFO - ------------------------------
      2016-06-10 15:08:07,044 INFO - Finished Importing : Users
      2016-06-10 15:08:07,044 INFO - ------------------------------
      2016-06-10 15:08:07,044 INFO - 0 users successfully created.
      2016-06-10 15:08:07,044 INFO - Retrieving projects...
      2016-06-10 15:08:07,045 ERROR - Unexpected failure occurred. Importer will stop immediately. Data may be in an unstable state
      java.lang.Exception: Unable to import Project ExternalProject{id='null', key='SAM', externalName='null', name='Sample data'}
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importProject(DefaultJiraDataImporter.java:648)
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:357)
      	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)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:538)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:501)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:254)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.atlassian.jira.plugins.importer.external.ExternalException: Unable to create project: ExternalProject{id='null', key='SAM', externalName='null', name='Sample data'}
      	at com.atlassian.jira.plugins.importer.managers.CreateProjectManagerImpl.createProject(CreateProjectManagerImpl.java:95)
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importProject(DefaultJiraDataImporter.java:633)
      	... 10 more
      Caused by: com.atlassian.jira.exception.CreateException: An invalid project type was specified. Unfortunately you can't create a project without a project type. Please talk to your JIRA administrator for help.
      	at com.atlassian.jira.plugins.importer.managers.CreateProjectManagerImpl.createProject(CreateProjectManagerImpl.java:82)
      	... 11 more
      2016-06-10 15:08:07,045 INFO - No issues need to be reindexed.
      

      Solution / Workaround

      Include the project type as per JSON below:

      {
          "projects": [
              {
                  "name": "Sample data",
                  "key": "SAM",
                  "type": "software",
                  "issues": [
                      {
                          "key" : "SAM-123",
                          "status" : "Open",
                          "reporter" : "admin",
                          "summary" : "Parent case",
                          "externalId": "123"
                      }
                  ]
              }
          ]
      }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last commented:
                3 years, 6 weeks, 1 day ago