Skip to content

Add GraphQL mutation to export work items

Felipe Cardozo requested to merge issue_379082-export_work_items_mutation into master

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

  1. Use rails console to enable import_export_work_items_csv feature flag.
  2. Create a project with some work items of different types, like incident, issues and test cases. Take a note of the project path.
  3. Execute the following GraphQL mutation, which should send an email to the logged user
mutation exportWorKitems {
  workItemExport(input: {
    projectPath: "PROJECT_PATH",
  }) {
    errors
  }
}
  1. 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.

Edited by Felipe Cardozo

Merge request reports

Loading