Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-67993

Attachments are broken when imported via a CSV import

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 7.6.2
    • Jira Importers Plugin
    • None

    Description

      Summary

      JIRA CSV import which contains attachments will cause the attachment files to corrupt. The file was copied to the correct directory and path and we are able to download it. However, it is not able to open it. This is caused by the URLs in the CSV export from the source system pointing to secure resources. So, when the target system runs a CSV import and tries to load the attachments via HTTP, it is redirected to the login page. The CSV importer follows the redirect and grabs the HTML content payload, and saves the attachment file with correct name, but with contents being HTML payload of the login page.

      Environment

      JIRA Version: 7.6.2

      Steps to Reproduce

      We will be using PPTX files as an example, it impacting image file, CSV, XML, Excel (all files types). We are exporting and importing CSV from same instance.

      1. Create a new Project and Issue
      2. Upload a PPTX slides attachment
      3. Use JQL to search for the issue and export all as CSV
      4. The CSV shall contain attachment field as well
      5. Create another new project and import the CSV files
      6. Once CSV import succeeds, access to the imported issue and download the PPTX file
      7. Open it with Power Point and it will show error
        PowerPoint found a problem with content in xxxx.ppt__PowerPoint can attempt to repair the presentation.__If you trust the source of this presentation, click repair.__There was an error accessing the file xxxxx.ppt
        

        It seems this import creating new files directory and a file for the newly imported attachment instead of reffering to old attachment directory.

      Expected Results

      We should be able to open the attachment file after the import

      Actual Results

      Attachments are corrupted.

      Work Around

      To work around this, you will need to give 'anonymous' access to the source project so that the import can download the necessary images. You can do this by

      1. Go to the source project, and Project Settings > Permissions
      2. Click Actions > Edit Permissions
      3. Click Edit next to Browse Projects 
      4. Click the Group radio button, and then select 'Anyone on the web'. 
      5. Click Grant. 

       WARNING: This gives public access to the project to anyone on the web, and can create a security risk, so do this at your own risk. Once the import is done, remove the 'anyone on the web' permission from Browse Projects. 

      Alternatively, you can download and copy the image files into <jira-home>/import folder on the server and import using the file:// format in the CSV. 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dkoh Danson (Inactive)
              Votes:
              29 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated: