For the complete documentation index, see llms.txt.
Skip to main content
Version: 8.10

GitLab connector

Use the GitLab connector to manage issues, releases, branches, repository files, and merge requests in GitLab from your BPMN process.

About this connector​

The GitLab connector is an outbound connector that calls the GitLab REST API on behalf of the user or service account that owns the access token. For example, use it to create an issue when a process step fails, or to open a merge request when an approval completes.

The connector is a protocol connector built on top of the HTTP REST connector, so it returns the same response.

Prerequisites​

To use the GitLab connector, you need a GitLab instance and an access token of a user or a service account on whose behalf the BPMN process runs.

note

Use secrets to avoid exposing your GitLab access token as plain text. See managing secrets.

Use this connector​

New to using an outbound connector? Learn how to add and use this type of connector, apply element templates, use connector secrets, handle results and errors, and more.

Configuration​

HTTP endpoint​

Configure the GitLab instance and the credentials the connector uses for all operations.

PropertyTypeRequiredDescriptionExample
GitLab base URLStringYesThe base URL of your GitLab instance. Must start with http:// or https://.https://gitlab.example.com
GitLab access tokenStringYesThe access token used to authenticate requests, sent to GitLab as PRIVATE-TOKEN.{{secrets.GITLAB_TOKEN}}

Operations​

In the Operation section, select an Operation group, then select the Operation to execute. The available operations depend on the group.

Every operation returns the response of the GitLab API. See Output.

Issues​

Get an issue by ID​

Retrieve a single issue. Uses the GitLab API Single project issue.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Issue IDStringYesThe internal ID of a project's issue.

Create an issue​

Create a new issue in a project. Uses the GitLab API New issue.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
TitleStringYesThe title of the issue.
DescriptionTextYesThe description of the issue.

Delete an issue​

Delete an issue from a project. Uses the GitLab API Delete an issue.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Issue IDStringYesThe internal ID of a project's issue.

Comment to an issue​

Add a comment to an issue. Uses the GitLab API Create new issue note.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Issue IDStringYesThe internal ID of a project's issue.
Note textTextYesThe content of the note.
Level on confidentialityDropdownYesSets the confidential flag of the note (an internal note): Confidential or Non-confidential. Default: Non-confidential.

Search issues​

Search for issues across GitLab. Uses the GitLab API List issues. All input parameters are optional.

Input parameters​
PropertyTypeRequiredDescriptionExample
ScopeDropdownNoWhich issues to return: All, Created by access token owner, or Assigned by access token owner. The default is All.
StateDropdownNoReturn all issues, or only those that are Opened or Closed. The default is All.
Assignee IDStringNoReturn issues assigned to the given user ID. Mutually exclusive with Assignee username. None returns unassigned issues. Any returns issues with an assignee.
Assignee usernameStringNoReturn issues assigned to the given username. Similar to Assignee ID and mutually exclusive with Assignee ID.
Author IDStringNoReturn issues created by the given user ID.
Contains textStringNoSearch issues against their title and description.

Releases​

List all releases by project ID​

List the releases of a project. Uses the GitLab API List releases.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.

Get release by a tag name​

Retrieve a release by its tag. Uses the GitLab API Get a release by a tag name.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Tag nameStringYesThe Git tag the release is associated with.

Create a release​

Create a release in a project. Uses the GitLab API Create a release.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Tag nameStringYesThe tag where the release is created from.
RefStringYesA commit SHA, another tag name, or a branch name.
Release nameStringNoThe name of the release.
DescriptionTextNoThe description of the release.

Branches​

List repository branches​

List the branches of a project. Uses the GitLab API List repository branches.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Search stringStringNoReturn the list of branches containing the search string.
Regular expressionStringNoReturn the list of branches with names matching a re2 regular expression.

Create repository branch​

Create a branch in a project. Uses the GitLab API Create repository branch.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
NameStringYesThe name of the new branch.
ReferenceStringYesThe branch name or commit SHA to create the branch from.

Repository files​

Create new file in repository​

Create a file in a project repository. Uses the GitLab API Create new file in repository.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Branch nameStringYesThe name of the new branch to modify the file in. The commit is added to this branch.
Commit messageStringYesThe message of the commit that modifies the file.
File contentTextYesThe content of the file.
File pathStringYesThe URL-encoded full path to the file.lib%2Fclass%2Erb
Author emailStringNoThe commit author's email address.
Author nameStringNoThe commit author's name.
EncodingStringNoChange the encoding to base64. GitLab's default is text.
Execute file modeBooleanNoEnables or disables the execute flag on the file. The default is false.
Start branchStringNoThe name of the base branch to start the new branch from.

Get file from repository​

Retrieve a file from a project repository. Uses the GitLab API Get file from repository.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
File pathStringYesThe URL-encoded full path to the file.lib%2Fclass%2Erb
ReferenceStringYesThe name of the branch, tag, or commit the file is fetched from.

Update existing file in repository​

Update a file in a project repository. Uses the GitLab API Update existing file in repository.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Branch nameStringYesThe name of the new branch to modify the file in. The commit is added to this branch.
Commit messageStringYesThe message of the commit that modifies the file.
File contentTextYesThe new content of the file.
File pathStringYesThe URL-encoded full path to the file.lib%2Fclass%2Erb
Author emailStringNoThe commit author's email address.
Author nameStringNoThe commit author's name.
EncodingStringNoChange the encoding to base64. GitLab's default is text.
Execute file modeBooleanNoEnables or disables the execute flag on the file. The default is false.
Start branchStringNoThe name of the base branch to start the new branch from.

Merge requests​

Create merge request​

Create a merge request in a project. Uses the GitLab API Create merge request.

Input parameters​
PropertyTypeRequiredDescriptionExample
Project IDStringYesThe global ID or URL-encoded path of the project owned by the authenticated user.
Source branchStringYesThe name of the source branch.
Target branchStringYesThe name of the target branch.
TitleStringYesThe title of the merge request.
Assignee IDsStringNoThe IDs of the users to assign the merge request to, as an array of numbers.
DescriptionStringNoThe description of the merge request.
LabelsStringNoThe labels for the merge request, as a comma-separated list.
Remove source branchBooleanNoIndicates whether the merge request removes the source branch when merging. The default is false.
Reviewer IDsStringNoThe IDs of the users to set as reviewers of the merge request, as an array of numbers.
SquashBooleanNoIndicates whether commits are squashed into a single commit when merging. Project settings might override this value. The default is false.
Target project IDStringNoThe numeric ID of the target project.

Output​

The GitLab connector is a protocol connector built on top of the HTTP REST connector. The response variables (status, headers, and body) are the ones described for the HTTP REST connector, where body contains the JSON returned by the GitLab API for the selected operation.

Use the Result variable or Result expression properties to map the response into process variables. For example, to keep the issue ID and URL after creating an issue:

= {
"issueId": response.body.iid,
"issueUrl": response.body.web_url
}

Troubleshooting​

To learn about general error handling in Camunda, see BPMN errors and failing jobs.

Further resources​