Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
7.6.2
-
None
-
7.06
-
21
-
Severity 2 - Major
-
14
-
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.
- Create a new Project and Issue
- Upload a PPTX slides attachment
- Use JQL to search for the issue and export all as CSV
- The CSV shall contain attachment field as well
- Create another new project and import the CSV files
- Once CSV import succeeds, access to the imported issue and download the PPTX file
- 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
- Go to the source project, and Project Settings > Permissions
- Click Actions > Edit Permissions
- Click Edit next to Browse Projects
- Click the Group radio button, and then select 'Anyone on the web'.
- 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
- relates to
-
JRACLOUD-68996 Attachments is broken when importing from CSV
- Gathering Interest