Skip to content

WorkItemUpdate mutation allows updating labels

Mario Celi requested to merge 339756-update-labels-mutation into master

What does this MR do and why?

Both WorkItemUpdate and WorkItemUpdateTask mutations now allow to add or remove labels from a work item. You can and and remove labels in a single mutation

How to set up and validate locally

Perform a Graphql query like this in GraphiQL:

mutation {
  workItemUpdate(
    input: {
      id: "gid://gitlab/Issue/47",
      labelsWidget: {
        addLabelIds: [
          "gid://gitlab/ProjectLabel/94",
          "gid://gitlab/GroupLabel/45",
          "gid://gitlab/ProjectLabel/96",
          "gid://gitlab/GroupLabel/49"
        ],
        removeLabelIds: ["gid://gitlab/ProjectLabel/95"]}}
  ) {
    workItem {
      widgets {
        type
        ... on WorkItemWidgetLabels {
          labels {
            nodes {
              id
              title
            }
          }
        }
      }
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #339756 (closed)

Edited by Mario Celi

Merge request reports