Errors when importing issues through CSV to Jira
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Importing issues through a CSV file can throw an error if the CSV contains values or fields that do not exist in the destination project/ instance. In this case the CSV file will need to edited to remove the problematic values highlighted in the logs, or the Instance needs to be updated to include these values.
Diagnosis
If there is an error when creating an issue through the import, due to an invalid field or value. An error similar to below will appear in the atlassian-jira.log;
2023-05-30 10:37:30,473 INFO - Importing issue: [externalId='autoid-1234567890', summary='Test import issue summary']
2023-05-30 10:37:30,473 ERROR - Error importing issue [externalId='autoid-1234567890', summary='Test import issue summary']
com.atlassian.jira.plugins.importer.external.ExternalException: Unable to create or update issue: [externalId='autoid-1234567890', summary='Test import issue summary']
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:921)
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:533)
at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
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:750)
Caused by: com.atlassian.jira.plugins.importer.imports.csv.ImportException: Priority [ Medium ] is not in the project [ TEST ] Priority Schema. Also Priority Schema couldn't be changed, because it's shared by more than one project.
at com.atlassian.jira.plugins.importer.imports.importer.impl.PriorityUtils.preFilterPriority(PriorityUtils.java:60)
at com.atlassian.jira.plugins.importer.imports.importer.impl.ExternalUtils.convertExternalIssueToIssue(ExternalUtils.java:543)
at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:898)
... 11 more
Cause
The above example error is caused by the Medium priority value, not existing in the priority scheme associated with the target project. Due this scheme being used by other projects it cannot automatically be updated, causing the issue creation to fail.
Solution
To resolve this error there are two solutions;
- The priority scheme associated with the target project, can be edited to contain the values in the CSV file
- The CSV file can be updated to only contain existing values from the target project.