Edit GitLab Issue

Action ID: gitlab:issue:edit
NPM Package:

@backstage/plugin-scaffolder-backend-module-gitlab

Description

Edit a Gitlab issue.

Input Schema

PropertyTypeDescriptionRequired
titlestringThe title of an issue.
tokenstringThe token to use for authorization to GitLab
epicIdnumberID of the epic to add the issue to. Valid values are greater than or equal to 0.
labelsstringComma-separated label names for an issue. Set to an empty string to unassign all labels. If a label does not already exist, this creates a new project label and assigns it to the issue.
weightnumberThe issue weight
dueDatestringThe due date. Date time string in the format YYYY-MM-DD, for example 2016-03-11.
repoUrlstring-
issueIidnumberThe internal ID of a project's issue
addLabelsstringComma-separated label names to add to an issue. If a label does not already exist, this creates a new project label and assigns it to the issue.
assigneesarrayIDs of the users to assign the issue to.
issueTypeany-
projectIdnumberThe global ID or URL-encoded path of the project owned by the authenticated user.
updatedAtstringWhen the issue was updated. Date time string, ISO 8601 formatted
stateEventany-
descriptionstringThe description of an issue. Limited to 1,048,576 characters.
milestoneIdnumberThe global ID of a milestone to assign the issue to. Set to 0 or provide an empty value to unassign a milestone
confidentialbooleanUpdates an issue to be confidential.
removeLabelsstringComma-separated label names to remove from an issue.
discussionLockedbooleanFlag indicating if the issue discussion is locked. If the discussion is locked only project members can add or edit comments.

Output Schema

PropertyTypeDescriptionRequired
statestringThe state event of an issue
titlestringThe title of an issue.
issueIdnumberThe issues Id
issueIidnumberThe issues internal ID of a project's issue
issueUrlstringIssue WebUrl
projectIdnumberThe project id the issue belongs to WebUrl
updatedAtstringThe last updated time of the issue.

Usage Examples

Add and remove labels, set milestone and due date

Update an existing issue by adding and removing labels, assigning a milestone, and setting a due date. Run this after generating files with fetch:template.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: updateIssueLabels
    action: gitlab:issue:edit
    input:
      repoUrl: "gitlab.com?owner=acme&repo=payments-service"
      projectId: ${{ parameters.projectId }}
      issueIid: ${{ parameters.issueIid }}
      addLabels: "area/backend,priority::high"
      removeLabels: "triage"
      milestoneId: 103
      dueDate: ${{ parameters.dueDate }} # e.g. "2025-12-15"
      title: "Payment gateway timeouts"
      description: "Track intermittent 504s from the provider during peak hours"
      token: ${{ parameters.gitlabToken }}

Close a resolved issue and set weight

Close an issue once automation has completed and set its weight to reflect the effort. This often follows a repository creation step such as publish:gitlab.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: closeIssue
    action: gitlab:issue:edit
    input:
      repoUrl: "gitlab.example.com?owner=platform&repo=service-catalog"
      projectId: 8421
      issueIid: ${{ parameters.issueIid }}
      stateEvent: "close"
      weight: 2
      addLabels: "resolved,automation"
      token: ${{ parameters.gitlabToken }}

Assign to multiple users and mark as confidential with epic and due date

Assign the issue to multiple engineers, mark it confidential, link it to an epic, and set a due date. Use this when the issue contains sensitive information.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: assignAndSecure
    action: gitlab:issue:edit
    input:
      repoUrl: "gitlab.com?owner=acme&repo=customer-portal"
      projectId: 5566
      issueIid: 231
      assignees:
        - 42
        - 77
      confidential: true
      epicId: 128
      dueDate: "2025-11-15"
      description: "Contains credentials and remediation steps. Limit visibility to project members."
      token: ${{ parameters.gitlabToken }}

Replace all labels and unassign milestone

Overwrite the issue labels with none and remove its milestone. Use this to reset triage after reclassification.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: resetLabelsAndMilestone
    action: gitlab:issue:edit
    input:
      repoUrl: "gitlab.com?owner=acme&repo=docs-site"
      projectId: ${{ parameters.projectId }}
      issueIid: ${{ parameters.issueIid }}
      labels: ""
      milestoneId: 0
      discussionLocked: false
      title: "Reset labels and milestone after triage"

Convert to incident, lock discussion, and update description

Convert an issue to an incident, lock the discussion to project members, and add incident labels. Use this for production-impacting events.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: incidentUpdate
    action: gitlab:issue:edit
    input:
      repoUrl: "gitlab.example.com?owner=sre&repo=oncall-runbook"
      projectId: 9901
      issueIid: 77
      issueType: "incident"
      discussionLocked: true
      stateEvent: "reopen"
      addLabels: "incident,P1,oncall"
      description: |
        Escalated to incident after error rate spike.
        Mitigation in progress. Next update at 15:30 UTC.
      token: ${{ parameters.gitlabToken }}