Importing attachments into JIRA Cloud using CSV External System Importer
When migrating between two Jira Cloud sites using the External System Import with a CSV file, you may get an error when loading an attachment of a migrated issue.
In case of an image, the first thing you'll note is that the thumbnail is broken:
Then, when clicking on it you'll get an error:
This happens because the CSV file comes with references to attachments that may be hosted on an instance that is not publicly accessible, which is the case for most customers. See an example below:
14/Feb/19 3:53 PM;admin;image.png;https://mysite.atlassian.net/secure/attachment/10000/image.png
In order to make this work, the user importing the CSV file to the target site needs access to the source site (and the issue/s being imported), then generate and add an API token to the URL in the CSV to authenticate to the instance. Please check the "Resolution section" to better understand how to proceed.
See an example below of the same attachment reference, now with authentication details. Note that the '@' symbol on the email address should be replaced with the HTML character '%40', followed by a colon and the API token. Finally, put an '@' symbol just before the hostname of your Cloud site. The rest of the URL will stay the same.
14/Feb/19 3:53 PM;admin;image.png;https://user%40domain.com:<API-Token>@mysite.atlassian.net/secure/attachment/10000/image.png
If the source JIRA site is a JIRA Server (self-hosted) instance
Instead of using your JIRA Cloud Email Address and API-Token, you should use your JIRA Server Username and Password instead. For example,
14/Feb/19 3:53 PM;admin;image.png;https://<JIRA-Server-Username>:<JIRA-Server-Password>@myjirasite.com/secure/attachment/10000/image.png