Add GraphQL mutation to export work items
What does this MR do and why?
Allows to export work items as CSV using a GraphQL mutation.
We will probably need to allow exporting work items state, I decided to keep it on a separate MR as this field is part of a widget.
related to #379082 (closed)
How to set up and validate locally
- Use rails console to enable
import_export_work_items_csvfeature flag. - Create a project with some work items of different types, like incident, issues and test cases. Take a note of the project path.
- Execute the following GraphQL mutation, which should send an email to the logged user
mutation exportWorKitems {
workItemExport(input: {
projectPath: "PROJECT_PATH",
}) {
errors
}
}
- Open http://127.0.0.1:3000/rails/letter_opener/ and check if the email attachment has an attachment with the expected CSV.
This mutation accepts other arguments to refine the export like, search, in, authorUsername, state, selectedFields, iids, and types.
We will probably need to allow exporting work items state, I decided to keep it on a separate MR as
this field is part of a widget.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Felipe Cardozo