Create GitLab Issue

Action ID: gitlab:issues:create
NPM Package:

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

Description

Creates a Gitlab issue.

Input Schema

PropertyTypeDescriptionRequired
titlestringTitle of the issue
tokenstringThe token to use for authorization to GitLab
epicIdnumberId of the linked Epic
labelsstringLabels to apply
weightnumberThe issue weight
dueDatestringDue date/time
repoUrlstring-
assigneesarrayIDs of the users to assign the issue to.
createdAtstringCreation date/time
issueTypeany-
projectIdnumberProject Id
descriptionstringIssue description
milestoneIdnumberGlobal ID of a milestone to assign the issue
confidentialbooleanIssue Confidentiality
discussionToResolvestringId of a discussion to resolve. Use in combination with "merge_request_to_resolve_discussions_of"
mergeRequestToResolveDiscussionsOfnumberIID of a merge request in which to resolve all issues

Output Schema

PropertyTypeDescriptionRequired
issueIdnumberIssue Id
issueIidnumberIssue Iid
issueUrlstringIssue Url

Usage Examples

Create a basic issue for a new service

Use this to open a starter issue right after project scaffolding. Typically triggered after fetch:template.

Copy
steps:
  - id: createBasicIssue
    action: gitlab:issues:create
    input:
      repoUrl: 'gitlab.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}'
      projectId: ${{ parameters.gitlabProjectId }}
      title: 'Bootstrap tasks for ${{ parameters.componentId }}'
      description: |
        Track initial setup tasks for ${{ parameters.componentId }}:
        - Configure CI
        - Add service README
        - Define health checks
      labels: 'onboarding, backlog'

Create a confidential security issue with assignees and due date

Use this for sensitive topics that only project members should see, assign it to multiple users, and set a due date and milestone.

Copy
steps:
  - id: createConfidentialSecurityIssue
    action: gitlab:issues:create
    input:
      repoUrl: 'gitlab.com?owner=security&repo=threat-models'
      projectId: 284392
      title: 'Security review for payment webhook'
      description: 'Perform STRIDE review and add mitigations for the new payment webhook.'
      confidential: true
      assignees: [1023, 1187]
      dueDate: '2025-02-10'
      milestoneId: 5401
      weight: 3
      labels: 'security, review, P1'

Create an issue to resolve a specific MR discussion

Use this to open an issue linked to a merge request and resolve a specific discussion thread in that MR.

Copy
steps:
  - id: createIssueToResolveDiscussion
    action: gitlab:issues:create
    input:
      repoUrl: 'gitlab.com?owner=${{ parameters.group }}&repo=${{ parameters.repoName }}'
      projectId: ${{ parameters.gitlabProjectId }}
      title: 'Follow-up: address code review feedback on logging'
      description: |
        Move remaining logging refactors out of MR !${{ parameters.mrIid }}.
        Ensure structured logging is applied across all modules.
      mergeRequestToResolveDiscussionsOf: ${{ parameters.mrIid }}
      discussionToResolve: '${{ parameters.discussionId }}'
      labels: 'refactor, tech-debt'

Create an incident linked to an epic using a provided token

Use this when the scaffolder needs to authenticate with a specific token, create an incident issue, and link it to an epic.

Copy
steps:
  - id: createIncidentIssue
    action: gitlab:issues:create
    input:
      repoUrl: 'gitlab.com?owner=platform&repo=prod-incidents'
      projectId: 671025
      token: ${{ secrets.gitlabToken }}
      title: 'SEV1: API latency spike in us-east-1'
      description: |
        Incident timeline and remediation tracking.
        Impact: elevated 99p latency > 3s for 15m on /orders endpoints.
      issueType: incident
      createdAt: '2025-01-15T10:12:00Z'
      epicId: 9021
      labels: 'incident, sev1, api'

Create a test-case issue with scheduling and labels

Use this to track QA work as test cases, set a due date, and tag appropriately during service onboarding.

Copy
steps:
  - id: createTestCaseIssue
    action: gitlab:issues:create
    input:
      repoUrl: 'gitlab.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}'
      projectId: ${{ parameters.gitlabProjectId }}
      title: 'Add integration test coverage for ${{ parameters.componentId }}'
      description: |
        Create integration tests for auth flows and payment retries.
        Ensure coverage for error handling and idempotency keys.
      issueType: test_case
      dueDate: '2025-03-01'
      labels: 'testing, integration, quality'