Resolve "Work Items list [BE] - Implement Import/Export by CSV"
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This merge request add WorkItemsCsvImport mutation
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
Create a sample csv file
title,description,due_date,milestone,type My Issue Title,My Issue Description,2022-06-28,,issue Another Title,"A description, with a comma",2022-06-28,,issue "One More Title","One More Description",2022-06-28,,issue An Issue with Quick Actions,"Hey can we change the frontend?",2022-06-28,,issue -
Send a GraphQL request containing the csv file through postman, because I dont think GraphQL Explorer currently supports upload file.
curl --location 'http://gdk.local:3000/api/graphql' \ --header 'Origin: http://gdk.local:3000' \ --header 'Referer: http://gdk.local:3000/-/graphql-explorer' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36' \ --header 'accept: */*' \ --header 'content-type: application/json' \ --form 'operations="{\"query\": \"mutation a(\$file: Upload\!) { workItemsCsvImport(input: { projectPath: \\\"flightjs\\/test\\\" file: \$file }) { errors message } }\", \"variables\": {\"file\": null}}"' \ --form 'map="{\"0\": [\"variables.file\"]}"' \ --form '0=@"/path/to/test.csv"'
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #510274 (closed)
Edited by long nguyen huy
