Feature #28198

Support issue relations when importing issues

Added by Gregor Schmidt 10 months ago. Updated 10 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:Unplanned
Resolution:

Description

As promised in #22701, I now would like to propose a patch, which adds handling of issue relations to the CSV importer.

Usage

The attached patch extends the import configuration view with a new block, so that users may select a column for each relation type. The parent issue field also moved to the new block, since it's conceptually related.

Within the CSV file the columns may define multiple relations of the same type, each separated with ,. Related issues follow the same rules as parent issues. A string preceded with a # is supposed to be an existing issue. Without the # it's supposed to be another row within the import file. For follows and precedes relations an additional delay may be present, e.g. #12 3d specifying a relation to issue #12 and a delay of 3 days.

Technical notes

Since issue relations may only be created when the issue was already saved, I've added a second step to the import. Additionally to build_object, which needs to be implemented by Import sub classes, there's also a extend_object method now. This is used by the IssueImporter to save the relations after the issue was already saved successfully.

Additional considerations

Initially, I wanted to build the import, so that issue relations exported from Redmine could be imported directly. But the format that's used by the exporter was designed for humans, not so much for computers. Most importantly, to parse this format we would need to grep for the localized relation names, which might even change between versions of Redmine. Therefore I settled for the proposed approach of having separate columns for each relation type.

0001-Support-issue-relations-when-importing-issues.patch Magnifier (16.2 KB) Gregor Schmidt, 2018-02-16 13:02

0002-Support-issue-relations-when-importing-issues.patch Magnifier - Patch on top of #28213 (19.8 KB) Gregor Schmidt, 2018-02-19 14:35


Related issues

Related to Redmine - Feature #22701: Allow forward reference to parent when importing issues Closed
Related to Redmine - Feature #28213: Support external ID when importing issues New

History

#1 Updated by Gregor Schmidt 10 months ago

This issue is in conflict with #28213. Since I would like to see both being applied, here's a patch for this issue applied on top of #28213

#2 Updated by Mischa The Evil 10 months ago

  • Related to Feature #22701: Allow forward reference to parent when importing issues added

#3 Updated by Mischa The Evil 10 months ago

  • Related to Feature #28213: Support external ID when importing issues added

#4 Updated by Mischa The Evil 10 months ago

  • Target version set to Unplanned

Also available in: Atom PDF