Cannot import attachments via CSV, any other alternatives available?

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2023

Below is the scenario we face :
* Migrated a project from on-prem to cloud, out of which a few issues failed
* Manually exported those issues via CSV from the on-prem instance and imported them to the Cloud instance
* Due to security concerns we cannot open the On-prem instance to external access so the Attachments dont get imported via the url in the CSV

I tried to run the "Migrate to Cloud" with "Attachments Only" for that one project but that didn't work as well.

3 answers

1 accepted

0 votes
Answer accepted
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

Made a REST API script to download the attachments of the issues, and then upload them via API again, it's not a clean workaround, and I loss the history of whose attachment it was originally but it got the job done for now.

Overal flow of the bash script : 

* Get the list of issues in a file (used a while loop to read thru this file, line by line)

* fetch the issue details, and store them in a Var.

* Get the Content URL and Name from the issue details (this can be saved another tmp file if needed)

* Download the attachment and save the output with the same name as the issues's attachment name

* Upload to the issue in Jira Cloud with the same name

 

2 votes
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2023

You need to pass your email+token in each attachment to securely upload an attachment to the Jira issue if these attachments are coming from a secure server.  This document explains how to do that. Alternatively, you can always use REST API to add an attachment to issues by creating a script after the issues have been imported.

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

As mentioned in my post "due security concerns we cannot open the On-prem instance to external access".

Will check the REST API approach and see if that works out by any chance.

Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2023

You don't need to open your instance to the public. The method mentioned is a secure attachment upload done via CSV which requires that you pass an authentication credential in the CSV file you'll upload to your Jira cloud environment. Read the document to get the full context

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 13, 2023

"pass an authentication credential in the CSV file" :Cannot do this either, the on-prem instance needs a VPN to be accessed.

I've made a REST API script to download the attachments of the issues, and then upload them via API again, it's not a clean workaround, and I loss the history of whose attachment it was originally but it got the job done for now.

0 votes
Magdalena Zhisheva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 10, 2023

Hi @Jehan Bhathena ,

As I know you need to change the Browse Project permission of the destination project to Public during the migration - Importing attachments via CSV file fails with exception 

P.S. I know that the article is for Server but it's the same for cloud - 100% sure & it's working!

Other option is to open a ticket with the support team.

Hope it helps!

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 10, 2023

 

Hi @Magdalena Zhisheva 

I cannot make the page public due to security concerns, and thus was looking for a different way to import the attachments.

Magdalena Zhisheva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2023

Hi @Jehan Bhathena ,

Well, in that case you can:
1. attach them manually or

2. contact the Atlassian support team and check if there is any other option.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events