Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Importing attachments using CSV file

manikanta ch June 4, 2020

Hello All,

We are migrating projects from one instance to another instance manually by CSV file. We are planning to migrate attachments using CSV file by the below method mentioned in the article-

https://confluence.atlassian.com/jirakb/how-to-convert-all-attachments-in-a-csv-file-to-use-file-protocol-for-an-external-system-import-973486944.html

We have almost ~1500 attachments in the projects. How to get attachments paths and Issue key of the attachments to the CSV file from the Server?.

Thanks in Advance,

Manikanta

2 answers

0 votes
Michael Kuhl {Appfire}
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.
June 5, 2020

Hi @manikanta ch - The Bob Swift Jira CLI has excellent support for working with attachments including being able to download and upload complete sets of attachments.

Briefly you would follow these steps:

  1. Use runFromIssueList combined with getAttachmentList to produce a CSV file for all of the attachments you wish to migrate.
  2. Use runFromCsv combined with getAttachment to download all of the attachments listed in the CSV.
  3. Finally, use runFromCsv combined with addAttachment to re-upload those attachments listed in the CSV to the issues.

FYI: I'm the product manager for the Bob Swift Atlassian CLI line of products.

0 votes
Dave Theodore [Coyote Creek Consulting]
Community Champion
June 4, 2020

I wouldn't recommend doing it this way. You're going to lose all the comments, as well as the history of issues, in addition to needing to turn all the attachments in to URLs. 

I'd recommend using Botron's Configuration Manager App instead. 

manikanta ch June 4, 2020

Hi @Dave Theodore [Coyote Creek Consulting] ,

We already have CM add-on in our instance. But we don't want to use this add-on for the migrations currently.

I will export and import all issue data, comments using CSV file. Please let me know if there is any solution for attachments as I mentioned above.

Thanks in advance,

Manikanta

Dave Theodore [Coyote Creek Consulting]
Community Champion
June 4, 2020

There is no way to export comments using native Jira capabilities. You will need to write a script to harvest them from the database, then put them in the correct format and add them to the CSV file.

Check this article on the format you will need to use for CSV importing attachments. You'll need to write a script that queries the database to pull out the original filename and the pointer to the file on disk, then rename the file back to the original name. Once you have that done, you will need to add the URL for each attachment to the CSV, with one attachment per column.  

I did this exact thing for a client years ago before Botron existed. It's probably 1000 times more work than just using their App.

manikanta ch June 4, 2020

I agree CM add-on is very easy to migrate projects from one instance to another instance. We have tested migrating projects using CM add-on multiple times but it is making global configuration changes for example - Priority icons, Issue links in the target instance even though we selected not to merge avatars and Description option.

Thanks for the article I will look into it.

Suggest an answer

Log in or Sign up to answer