CSV import Parent-child mapping
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
Importing parent-child relationship using CSV import in a Company-managed project.
Previous versions of this KB made reference to using the "Epic Link" field. However this KB has been updated as of April 2024 to reflect the changes in regards to the Deprecation of the Epic Link and Epic Name fields. Going forward with Jira Cloud, the Parent field should be used instead.
環境
In the Jira Cloud, whenever we import a CSV backup of issues to a production site that contains Epic->Stories/Task->Sub-tasks relationships the epic child relationship can be tricky to maintain.
The purpose of this article is to simplify this process for the users for a seamless CSV import experience when importing issues with mapped hierarchies.
診断
Whenever a CSV import is performed, we usually end up losing Parent-child relationships.
原因
This is due to issue order in the CSV file and improper mapping of the parent and child during the import process.
ソリューション
Firstly, make sure the exported CSV file contains at least the following columns for the parent-child mapping:
Issue type, Issue key, Issue ID, Summary, Parent
Please make sure that the Issue types are always listed based on theirs hierarchy in rows. That is the topmost rows should list all the Highest hierarchy issue types and then following the Standard issue types and then the Sub-tasks.
ORDER of importance top to bottom layout:
<TOP OF FILE>
- Initiative and other higher levels
- エピック
- Standard issue types (Story, Bug, task, etc...)
- サブタスク
</BOTTOM OF FILE>
- For the parent→child relationship to work, copy the 'Issue ID' of the parent issue type and paste it in the 'Parent' column of the the Child issue type.
- After making the above changes, the Issue Type mappings should look as per the below sample screenshot.
Example CSV With the following layout:
- NOTE The ID's used are place holder numbers, they can be any number but MUST be unique per issue per csv import.
issuetype | 課題キー | ステータス | 要約 | issue id | parent |
テーマ | test-123 | 作業前 | Example theme summary | 1 | |
initiative | test-124 | 作業前 | Example initiative summary | 2 | 1 |
エピック | test-125 | 作業前 | Epic with parent and no child story but 1 sub-task and parent Initiative | 3 | 2 |
エピック | test-126 | 作業前 | This is an epic with 1 story and 1 bug as child issues mapped | 4 | |
ストーリー | test-127 | 作業前 | Example story 1 Summary no child issue mapped | 5 | |
ストーリー | test-128 | 作業前 | Example story with 1 child subt-ask mapped, and a parent epic is mapped | 6 | 4 |
バグ | test-129 | 作業前 | bug with 1 child sub-task | 106589 | 4 |
サブタスク | test-130 | 作業前 | subtask 1 | 7 | 6 |
サブタスク | test-131 | 作業前 | subtask 2 | 8 | 106589 |
サブタスク | test-132 | 作業前 | Subtask 3 | 9 | 3 |
As Raw text in CSV formatting:
issue type,issue key,status,summary,issue id,parent
Theme,test-123,To Do,Example theme summary,1,
initiative,test-124,To Do,Example initiative summary,2,1
Epic,test-125,To Do,Epic with parent and no child story but 1 sub-task and parent Inititive,3,2
Epic,test-126,To Do,This is an epic with 1 story and 1 bug as child issues mapped,4,
Story,test-127,To Do,Example story 1 Summary no child issue mapped,5,
Story,test-128,To Do,"Example story with 1 child subt-ask mapped, and a parent epic is mapped",6,4
Bug,test-129,To Do,bug with 1 child sub-task ,106589,4
sub-task,test-130,To Do,subtask 1,7,6
sub-task,test-131,To Do,subtask 2,8,106589
sub-task,test-132,To Do,Subtask 3,9,3
- In the above table, we have used the "Issue Key" column only for a better visual understanding of the table. When the issues are imported into the destination project, they will be taking a new issue number (based on the issue counter on the destination project) and the destination project key. For example, if we import the above issues to a destination project which has the project key "CSV", and no pre existing issues, then these newly imported issues will have the issue key as CSV-1, CSV-2, ... etc.
The CSV file is now ready for import.
Now follow the below steps to import the CSV file.
- Under the Jira admin settings > Import and export > External system import
- Select "Switch to the old experience"
- Select CSV
- Upload this CSV file by clicking on "Choose File" and navigating to the file via your local file explorer
- hit next once uploaded
- Select the destination project where you want the issues to be imported from the CSV file.
- Leaving formatting as default unless you made customized changes to any additional date and time fields or email address fields
- Map the CSV fields with the corresponding Jira fields as shown in the below sample screenshot.
- Click on "Next"
- Verify status mappings of fields text value in file "Value from Importer" to actual status in the Jira system "Target value in Jira"
- Click "Begin import"
- After a successful import, the Parent->Child issue type relation should look like this as per the below screenshot.
In the issue view:
- Example Theme→Initiative and Initiative→Epic relation should look like this as per the below screenshots.
- Example Epic→Story and Epic→Subtask relation should look like this as per the below screenshots.
- And the Story→Subtask and Bug →Subtask relation should look like this as per the below screenshots.
Similarly, you can include any other custom field columns in the exported CSV file and import it in one go along with the correct parent-child mapping as we discussed in the above steps.