Import: Migrate One-To-Many Relationships To JIRA Using CSV Import

JIRA 5.2:

I am migrating issues from an old bug tracking system to JIRA using the CSV import feature. I have exported the main issues table to a CSV file, but there are related tables that have a one-to-many relationship with the issues, for example, audit trail of incident updates, as well as attachments for each issue.

I see how to import the issues, but not how to import related records -- possibly multiples -- for each issue. Is there a way to preserve the related data in the migration?

3 answers

1 accepted

@Renjith, actually we support importing issue history now.

@AnonyMe - so to preserve one-to-many relationships in CSV file you use just multiple columns for the same item, like you can have multiple columns named Comment and they will be automatically combined, the same goes for other items like Attachment, Label, etc.

Building such a complex file might be tricky so I suppose you would want to make a script that will dump the original database to it - so you can easily iterate with your work.

Also if you want to have a more structured file (and more control over CSV) you can try using our JSON (beta) format. But this is an advanced technique. Here's some documentation https://confluence.atlassian.com/pages/viewpage.action?pageId=293830712

@Pawel - thanks for the advice, although I am still confused. Each issue that I am migrating can have zero or more updates, so how do I account for this variable number of updates per issue by adding columns to my CSV file?

I will look into the article on using JSON, but I could also do a direct migration from one database to the other, either through updatable views or through export/import since both the source and the target databases are SQL Server (albeit different versions). Is there anything I need to be mindful of once I familiarize myself with the JIRA structure, like triggers, etc.?

I found the latest data schema documentation on your website, athough I have to say it is very hard to read and seems not very printer-friendly.

Thanks again for your help!

To create a propert CSV file in this case you'd have to create a script that would keep all records in history and then check what's the biggest numer of changes, attachments, comments, etc. and create so many columns for them. In case of issues having less items columns can be empty.

I guess using JSON in this case would be more intuitive for your - as each object is really well structured and can contain different details than others.

I know that some customers do copy data directly to JIRA database. I'm not an expert on that. The one thing to remember is to update all sequences correctly. I've created a Trac to JIRA importer using database directly couple of years ago, I know it's doable, but required couple of days to figure out all issues. I think JIRA Data Generator source code may give you some hints about iternal db structure. But I might be wrong.

ok, I understand my options. I will investigate the JSON approach first. Thank you for your responses.

Issue history import is not supported using CSV, AFAIK. While attachments can be done as documented at https://confluence.atlassian.com/display/JIRA/Importing+Data+from+CSV#ImportingDatafromCSV-Importingattachments

You can import historical data by using JSON importer (beta) - part of JIRA Importers Plugin bundled with JIRA. But that will require some data pre-processing (into JSON format understood by the importer) on your side.

If you want just to stick to CSV import, then you can play with issue update capaiblity offered by it. I.e. if you denote one of your columns in CSV as the issue key (which has to match an issue key already in JIRA), then you can effectively update an existing issue and thus import changes to its status, field values or e.g. import more worklog information.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

106 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you