Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-64674

JSON importer can't import attachment with (chinese/korean/japanese) character

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.

      Summary

      When trying to import attachment with (chinese/korean/japanese) character in it using JSON importer, issue get created with no attachment.

      Steps to Reproduce

      1. Import the attached JSON file using the JSON external importer.
      2. Sample JSON code:
        {
          "projects": [
            {
              "key": "MO",
              "name": null,
              "description": "",
              "issues": [
                {
                  "priority": "P4 (No Impact/Notify)",
                  "description": "ABC ABC",
                  "status": "Done",
                  "reporter": "user1",
                  "issueType": null,
                  "resolution": "Fixed",
                  "created": "2013-01-03T22:36:00",
                  "updated": "2013-01-03T22:36:00",
                  "resolutionDate": "2013-01-17T08:22:00",
                  "summary": "ABC ABC",
                  "assignee": "user1",
                  "watchers": [],
                  
                  "attachments": [
                    
                    {
                      "name": "QC공정(4M기준)_양1.png",
                      "attacher": "user1",
                      "created": "2015-09-08T09:51:12.1681238+08:00",
                      "uri": "file:///C:/Users/IT/Downloads/QC공정(4M기준)_양1.png",
                      "description": null
                    }
                  ],
                  "comments": [
                              ]
                }
              ]
            }
          ]
        }
        

      Expected Results

      Issue get created together with attachment.

      Actual Results

      Issue get created and no attachment. The below exception is thrown in the log file:

      2015-09-09 17:17:12,335 INFO - Import started by admin using com.atlassian.jira.plugins.importer.sample.SampleDataBean
      2015-09-09 17:17:12,336 INFO - ------------------------------
      2015-09-09 17:17:12,337 INFO - Importing: Users
      2015-09-09 17:17:12,337 INFO - ------------------------------
      2015-09-09 17:17:12,337 INFO - Only new items will be imported
      2015-09-09 17:17:12,337 INFO - 0 users associated with import. 0 new users were created and imported as active.
      2015-09-09 17:17:12,337 INFO - ------------------------------
      2015-09-09 17:17:12,337 INFO - Finished Importing : Users
      2015-09-09 17:17:12,337 INFO - ------------------------------
      2015-09-09 17:17:12,337 INFO - 0 users successfully created.
      2015-09-09 17:17:12,337 INFO - Retrieving projects...
      2015-09-09 17:17:12,338 INFO - Project ExternalProject{id=null, externalName=null, name=null, key=MO, url=null, lead=null, description=, projectCategoryName=null, avatarUrl=null, assigneeType=null, versionCount=0, componentCount=0, issueCount=1} already exists. Not imported
      2015-09-09 17:17:12,338 INFO - ------------------------------
      2015-09-09 17:17:12,338 INFO - Importing: Versions
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Only new items will be imported
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Finished Importing : Versions
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Importing: Components
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Only new items will be imported
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Finished Importing : Components
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Retrieving custom fields...
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Importing: Issues
      2015-09-09 17:17:12,339 INFO - ------------------------------
      2015-09-09 17:17:12,339 INFO - Only new items will be imported
      2015-09-09 17:17:12,365 INFO - Importing issue: ExternalIssue{externalId=null, summary=ABC ABC, issueType=null}
      2015-09-09 17:17:12,699 WARN - An exception occurred dealing with attachment 'file:///C:/Users/IT/Downloads/양.png'.
      com.atlassian.jira.plugins.importer.imports.AttachmentImportException: An exception occurred dealing with attachment 'file:///C:/Users/IT/Downloads/양.png'.
      	at com.atlassian.jira.plugins.importer.imports.json.JsonAttachmentsProvider.getAttachmentForIssue(JsonAttachmentsProvider.java:46)
      	at com.atlassian.jira.plugins.importer.sample.SampleDataBean.getAttachmentsForIssue(SampleDataBean.java:113)
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:949)
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:775)
      	at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:401)
      	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:528)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:254)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
      	at java.io.WinNTFileSystem.canonicalize0(Native Method)
      	at java.io.WinNTFileSystem.canonicalize(Unknown Source)
      	at java.io.File.getCanonicalPath(Unknown Source)
      	at java.io.File.getCanonicalFile(Unknown Source)
      	at com.atlassian.jira.plugins.importer.imports.AttachmentImporter.importAttachmentFrom(AttachmentImporter.java:57)
      	at com.atlassian.jira.plugins.importer.imports.json.JsonAttachmentsProvider.getAttachmentForIssue(JsonAttachmentsProvider.java:41)
      	... 13 more
      2015-09-09 17:17:12,708 INFO - Reindexing last 1 issues imported ...
      2015-09-09 17:17:12,783 INFO - Reindexing took 74 ms.
      2015-09-09 17:17:12,784 INFO - 1 issues successfully created
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - Finished Importing : Issues
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - Importing: Issue Links & Subtasks
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - Only new items will be imported
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - Finished Importing : Issue Links & Subtasks
      2015-09-09 17:17:12,784 INFO - ------------------------------
      2015-09-09 17:17:12,784 INFO - No issues need to be reindexed.
      

      Attachments

        Issue Links

          Activity

            People

              ohookins@atlassian.com Oliver Hookins (Inactive)
              Anonymous Anonymous
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: