com.atlassian.jira.plugins.importer.external.ExternalException: Status To Do cannot be found in JIRA neither by name and id

Atlassian JIRA | Vinicius Fontes [Atlassian] | 8 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    h3. Summary JIRA fails to import a project using JSON. If the project contains a custom ranking field, it will be added to JIRA even if the import fails. h3. Environment * JIRA 7.1.9 h3. Steps to Reproduce # Deploy a fresh JIRA 7.1.9 instance. # Create a new Scrum project named TEST. # Create 3 stories. # Rank the stories. # Add a new custom field of type *Global Rank* with the name *Test Rank*. # Rebalance all fields in *System > LexoRank management > Balance all fields*. # On *Manage add-ons*, enable the modules {{searchrequest-json}} and {{issue-json}} on the *jira-importers-plugin*. # Run the JQL query {{project = TEST ORDER BY Rank ASC}} # Click *Export > JSON* and save the results as a JSON file. # Deploy another fresh JIRA 7.1.9 instance. # Navigate to *System > External System Import > JSON*. # Select the previously exported JSON file and click *Begin Import* # The import will fail. # Navigate to *Issues > Custom Fields*. # Notice how the *Test Rank* field was added even though the import failed. h3. Expected Results The import completes successfully. h3. Actual Results The import fails and generates the log below. However, the *Test Rank* field will be created in JIRA. {code:none|borderStyle=solid|borderColor=#6A8EB3|bgColor=#F8F8F8|title=Import failure log} 2016-08-09 17:21:10,085 INFO - Import started by admin using com.atlassian.jira.plugins.importer.sample.SampleDataBean 2016-08-09 17:21:10,097 INFO - ------------------------------ 2016-08-09 17:21:10,097 INFO - Importing: Users 2016-08-09 17:21:10,097 INFO - ------------------------------ 2016-08-09 17:21:10,097 INFO - Only new items will be imported 2016-08-09 17:21:10,099 INFO - 1 users associated with import. All of them imported as inactive, this can be changed after import in User Access step. 2016-08-09 17:21:10,099 INFO - ------------------------------ 2016-08-09 17:21:10,099 INFO - Finished Importing : Users 2016-08-09 17:21:10,099 INFO - ------------------------------ 2016-08-09 17:21:10,099 INFO - 0 users successfully created. 2016-08-09 17:21:10,099 INFO - Retrieving projects... 2016-08-09 17:21:10,388 INFO - Created Project: ExternalProject{id='null', key='TEST', externalName='TEST', name='TEST'} successfully 2016-08-09 17:21:10,413 INFO - ------------------------------ 2016-08-09 17:21:10,413 INFO - Importing: Versions 2016-08-09 17:21:10,413 INFO - ------------------------------ 2016-08-09 17:21:10,413 INFO - Only new items will be imported 2016-08-09 17:21:10,413 INFO - ------------------------------ 2016-08-09 17:21:10,413 INFO - Finished Importing : Versions 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Importing: Components 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Only new items will be imported 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Finished Importing : Components 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Retrieving custom fields... 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Importing: Issues 2016-08-09 17:21:10,414 INFO - ------------------------------ 2016-08-09 17:21:10,414 INFO - Only new items will be imported 2016-08-09 17:21:10,416 INFO - Importing issue: [externalId='null', summary='Story #3'] 2016-08-09 17:21:10,510 INFO - Custom field not found. Creating a new custom field for com.atlassian.jira.plugins.importer.external.beans.ExternalCustomField@357d34c5[id=Test Rank,name=Test Rank,typeKey=com.pyxis.greenhopper.jira:gh-lexo-rank,searcherKey=com.pyxis.greenhopper.jira:gh-lexo-rank-searcher,valueMappingDefinition=<null>,valueSet=<null>] 2016-08-09 17:21:10,557 ERROR - Error importing issue [externalId='null', summary='Story #3'] com.atlassian.jira.plugins.importer.external.ExternalException: Status To Do cannot be found in JIRA neither by name and id at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.normalizeStatus(ExternalUtils.java:218) at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.createIssue(ExternalUtils.java:190) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:925) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798) 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) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:421) 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:216) at java.lang.Thread.run(Thread.java:745) 2016-08-09 17:21:10,558 INFO - Importing issue: [externalId='null', summary='Story #1'] 2016-08-09 17:21:10,560 ERROR - Error importing issue [externalId='null', summary='Story #1'] com.atlassian.jira.plugins.importer.external.ExternalException: Status To Do cannot be found in JIRA neither by name and id at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.normalizeStatus(ExternalUtils.java:218) at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.createIssue(ExternalUtils.java:190) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:925) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798) 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) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:421) 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:216) at java.lang.Thread.run(Thread.java:745) 2016-08-09 17:21:10,560 INFO - Importing issue: [externalId='null', summary='Story #2'] 2016-08-09 17:21:10,562 ERROR - Error importing issue [externalId='null', summary='Story #2'] com.atlassian.jira.plugins.importer.external.ExternalException: Status To Do cannot be found in JIRA neither by name and id at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.normalizeStatus(ExternalUtils.java:218) at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.createIssue(ExternalUtils.java:190) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:925) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798) 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) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453) at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:421) 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:216) at java.lang.Thread.run(Thread.java:745) 2016-08-09 17:21:10,565 INFO - 3 issues successfully created 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,565 INFO - Finished Importing : Issues 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,565 INFO - Importing: Issue Links & Subtasks 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,565 INFO - Only new items will be imported 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,565 INFO - Finished Importing : Issue Links & Subtasks 2016-08-09 17:21:10,565 INFO - ------------------------------ 2016-08-09 17:21:10,566 INFO - No issues need to be reindexed. {code} h3. Workaround Unknown. h3. Notes I'm attaching the JSON file for reference and to speed up this bug reproduction. When using the JSON file you can reproduce the bug starting from step 10.

    Atlassian JIRA | 8 months ago | Vinicius Fontes [Atlassian]
    com.atlassian.jira.plugins.importer.external.ExternalException: Status To Do cannot be found in JIRA neither by name and id

    Root Cause Analysis

    1. com.atlassian.jira.plugins.importer.external.ExternalException

      Status To Do cannot be found in JIRA neither by name and id

      at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.normalizeStatus()
    2. com.atlassian.jira
      TaskManagerImpl$TaskCallableDecorator.call
      1. com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.normalizeStatus(ExternalUtils.java:218)
      2. com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.createIssue(ExternalUtils.java:190)
      3. com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:925)
      4. com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:798)
      5. com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:414)
      6. com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)
      7. com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)
      8. com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:453)
      9. com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:421)
      9 frames
    3. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3 frames
    4. com.atlassian.jira
      ForkedThreadExecutor$ForkedRunnableDecorator.run
      1. com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
      1 frame
    5. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame