Skip to content

Fix issue import to accept export format

Josianne Hyson requested to merge jhyson-issue-import-export-consistency into master

What does this MR do?

Addresses:

Currently the CSV created by Issue export does not match the format expected for Issue import. This MR updates the issues CSV importer to be able to handle correctly importing the title and description from a GitLab created issues export.

Current Behaviour

Export Format

https://docs.gitlab.com/ee/user/project/issues/csv_export.html#format

Issue ID,URL,Title,State,Description,Author,Author Username,Assignee,Assignee Username,Confidential,Locked,Due Date,Created At (UTC),Updated At (UTC),Closed At (UTC),Milestone,Weight,Labels,Time Estimate,Time Spent,Epic ID,Epic Title
1,http://localhost:3000/jashkenas/underscore/issues/1,Title,Open,,Elva Jerde,jamel,Tierra Effertz,aurora_hahn,No,No,,2020-01-17 10:36:26,2020-02-19 10:36:26,,v1.0,,"Brene,Cutlass,Escort,GVM",0,0,,

Import Format

https://docs.gitlab.com/ee/user/project/issues/csv_import.html#csv-file-format

In the existing implementation the header values are actually ignored and we determine the values for the rows based on their position.

title,description
My Issue Title,My Issue Description
Another Title,"A description, with a comma"
"One More Title","One More Description"

Updated Behaviour

The behaviour of the exporter is unchanged.

Update the importer to look for the values by the header value, rather than positional values. All extra values are ignored.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • ~~Label as security and @ mention @gitlab-com/gl-security/appsec~~
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports