Importing attachments via CSV file fails with exception
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
Attempting to import attachments via CSV results in error "An exception occurred dealing with attachment."
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.
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.