-
Bug
-
Resolution: Unresolved
-
Low (View bug fix roadmap)
-
None
-
7.8.0
-
7.08
-
4
-
Severity 3 - Minor
-
1
-
Problem
Importing a CSV with different parent id specified could result in association with multiple parents.
Steps to reproduce the issue.
- Create a new project.
- Create two tasks, called it Parent 1 and Parent 2 respectively.
- Create two sub-tasks for Parent 1.
- In the issue navigator, search for all issues in the new project.
- Add Sub-Tasks as one of the columns and remove other columns.
- Export the result as CSV with current fields.
- The CSV file will look like the following.
Issue Type,Issue key,Issue id,Parent id,Summary,Assignee,Reporter Sub-task,CSVI-4,10103,10100,Sub-task 2,,admin Sub-task,CSVI-3,10102,10100,Sub-task 1,,admin Task,CSVI-2,10101,,Parent 2,,admin Task,CSVI-1,10100,,Parent 1,,admin
- Edit the CSV file to change the parent id of Sub-task 2 from Parent 1 to Parent 2.
Issue Type,Issue key,Issue id,Parent id,Summary,Assignee,Reporter Sub-task,CSVI-4,10103,10101,Sub-task 2,,admin Sub-task,CSVI-3,10102,10100,Sub-task 1,,admin Task,CSVI-2,10101,,Parent 2,,admin Task,CSVI-1,10100,,Parent 1,,admin
- Import the CSV file via Administration > System > External System Import > CSV.
- Map the values only for issue ID, issue type, issue key and summary.
Expected result
Sub-task 2 will be a sub-task of Parent 2 and only Parent 2.
Actual result
Sub-task 2 will be a sub-task of both Parent 1 and Parent 2.
It's also associated to 2 parent tasks in the database.
select i.id as "child_id", ( p.pkey || '-' || i.issuenum ) as "child_key", it.pname as "child_type", it.pstyle as "child_type_style", t.count as "number_of_parents", parent_i.id as "parent_id", ( parent_p.pkey || '-' || parent_i.issuenum ) as "parent_key", parent_it.pname as "parent_type" from jiraissue i join project p on i.project = p.id join issuetype it on i.issuetype = it.id join (select destination, count(*) from issuelink where linktype= (select id from issuelinktype where linkname = 'jira_subtask_link') group by destination having count(*) > 1) t on i.id = t.destination join issuelink parent_l on i.id = parent_l.destination join jiraissue parent_i on parent_l.source = parent_i.id join project parent_p on parent_p.id = parent_i.project join issuetype parent_it on parent_i.issuetype = parent_it.id where parent_l.linktype in (select id from issuelinktype where linkname = 'jira_subtask_link') order by child_id desc;
Here's the result from the database.
child_id | child_key | child_type | child_type_style | number_of_parents | parent_id | parent_key | parent_type |
---|---|---|---|---|---|---|---|
10103 | CSVI-4 | Sub-task | jira_subtask | 2 | 10101 | CSVI-2 | Task |
10103 | CSVI-4 | Sub-task | jira_subtask | 2 | 10100 | CSVI-1 | Task |
Workaround
Use the Move Issue operation to change the parent to Parent 2. That way, the association with Parent 1 will be dismissed.
- is related to
-
MIG-359 Lack of parent/sub-task validation in CSV import causes invalid state
-
- Closed
-