Importing attachments into Jira Cloud using CSV External System Importer

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

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: 

Cause

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:

18/Jul/23 3:53 PM;image.png;https://mysite.atlassian.net/rest/api/2/attachment/content/10000

Resolution

(warning) Please beware that some applications commonly used to edit CSV files may automatically reformat (and break) it when you save the file. 

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.

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.

18/Jul/23 3:53 PM;image.png;https://user%40domain.com:<API-Token>@mysite.atlassian.net/rest/api/2/attachment/content/10000


If the source JIRA site is a JIRA Server or Data Center (self-hosted) instance

Instead of using your JIRA Cloud Email Address and API-Token, you must use your JIRA Server or Data Center Username and Password instead. For example,

18/Jul/23 3:53 PM;image.png;https://adminuser:password@myjirasite.com/secure/attachment/10000/filename

Note:

  • If the password or username has special characters, such as #, ^, %, $, *, etc, then they must be replaced by their URL Encoded equivalent. ( This is only for Server to Cloud External System Import)

  • This method does not support external authentication methods such as Single Sign On. You must use local credentials for the Jira On-Prem account
  • Its recommended to reset the account credentials after all CSV imports have been completed to Jira Cloud.



Last modified on Apr 5, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.