Importing attachments via CSV file fails with exception
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Attempting to import attachments via CSV results in error "An exception occurred dealing with attachment."
Cause
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. Therefore, in order to make this work, we need to make that project accessible in a way that it doesn't require a login.
Solution
We can do this by modifying the project permissions to give anonymous access to the source project so that a login isn't required. You can do this by:
Go to the source project, and click 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.
You should then be able to import as expected using the original method you were attempting.
⚠️You'll want to go back and remove that permission once the import is complete to avoid any security issues.
Was this helpful?