Skip to content

Add labels to issues update mutation

What does this MR do?

Related to #208782 (closed)

This MR adds the arguments add_label_ids and remove_label_ids to the IssuesUpdate mutation to allow us to change labels in an issue.

These attributes are already being handled by IssuableBaseService when using Issues::UpdateService so it is sufficient with adding them as arguments to the mutation for it to work.

Similarly, We allow to update an epic's label by including these arguments in SharedEpicArguments.

Example query

mutation {
  updateIssue(input: {projectPath: "issue-reproduce/sub-group/test-project", iid: "1", removeLabelIds: [1480632], addLabelIds: [2098981, 2778788]}){
    issue{
      iid
      title
      dueDate
    }
    
  }
}

Screenshots

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 Eugenia Grieff

Merge request reports