Unable to import file attachment from CSV

Platform Notice: Cloud and Data Center - This article applies equally to both cloud 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

Symptoms

When importing issues from a CSV file, the issues are imported but a warning message is displayed stating that the attachments could not be parsed as below:

(Auto-migrated image: description temporarily unavailable)

By downloading the detailed log, the exception below can be seen:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2013-12-06 18:36:45,189 WARN - Cannot parse 'file://csvimport/test attachment.bmp' as attachment info: Illegal character in path at index 21: file://csvimport/test attachment.bmp java.text.ParseException: Illegal character in path at index 21: file://csvimport/test attachment.bmp at com.atlassian.jira.plugins.importer.imports.csv.mappers.ExternalAttachmentMapper.validateURI(ExternalAttachmentMapper.java:86) at com.atlassian.jira.plugins.importer.imports.csv.mappers.ExternalAttachmentMapper.parse(ExternalAttachmentMapper.java:56) at com.atlassian.jira.plugins.importer.imports.csv.CsvDataBean.getAttachmentsForIssue(CsvDataBean.java:445) at com.atlassian.jira.plugins.importer.imports.csv.CsvDataBean.getAttachmentsForIssue(CsvDataBean.java:415) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:987) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:837) at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:422) 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:374) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:250) at java.lang.Thread.run(Thread.java:724)

Cause

This issue may be caused because the attachment file being imported has special or reserved characters (e.g. space) in the file name, which are not supported in the file URI scheme used during the CSV attachment import.

Resolution

There are two options to resolve this issue:

  1. Rename the files so that they don't have special characters in their names (e.g. replace the spaces for underscores).

  2. Change the CSV file to use percent encoding for the special characters in the file name inside the CSV file.

    In the example below, the space was encoded to %20:

    example.csv

    1 2 Summary,Description,Issue Type,Priority,Assignee,Reporter,Attachments Test Import JIRA,"Test File Import",Task,Major,jirauser,jirauser,file://csvimport/test%20attachment.bmp

In case the solutions above do not solve the issue, please refer to this article: (Archive) Unable to import file attachment from CSV due to NullPointerException

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.