Integrations / GitLab
GitLab
Code hosting and DevOps: projects, issues and merge requests on GitLab.com.
8 actions
OAuth 2
5 read3 write
Calls gitlab.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "gitlab" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
api | Read and write your GitLab projects, issues and merge requests, and identify your account |
Actions
Create issuewritegitlab.create_issueCreate a new issue in a project with a title, optional description and labels.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
title | string | Required | Issue title |
description | string | Optional | Issue description (Markdown) |
labels | string | Optional | Comma-separated label names |
await setu.execute({
userId: "user_1",
action: "gitlab.create_issue",
input: {
"project": "<project>",
"title": "<title>"
},
});Comment on issuewritegitlab.create_issue_noteAdd a comment to an issue, identified by project and issue number (iid).
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
issue_iid | integer | Required | Issue number within the project (iid) |
body | string | Required | Comment text (Markdown) |
await setu.execute({
userId: "user_1",
action: "gitlab.create_issue_note",
input: {
"project": "<project>",
"issue_iid": 1,
"body": "<body>"
},
});Get merge requestreadgitlab.get_merge_requestGet one merge request by project and number (iid): title, state, branches and web URL.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
merge_request_iid | integer | Required | Merge request number within the project (iid) |
await setu.execute({
userId: "user_1",
action: "gitlab.get_merge_request",
input: {
"project": "<project>",
"merge_request_iid": 1
},
});Get projectreadgitlab.get_projectGet one project by numeric id or full path: name, description, default branch and web URL.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
await setu.execute({
userId: "user_1",
action: "gitlab.get_project",
input: {
"project": "<project>"
},
});List issuesreadgitlab.list_issuesList issues in a project, filtered by state, labels or search text. Returns issue numbers (iid), titles and states.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
state | string | Optional | Which issues |
labels | string | Optional | Comma-separated label names; issues must have all of them |
search | string | Optional | Match in title and description |
per_page | integer | Optional | Results per page, up to 100 |
await setu.execute({
userId: "user_1",
action: "gitlab.list_issues",
input: {
"project": "<project>"
},
});List merge requestsreadgitlab.list_merge_requestsList merge requests in a project, optionally by state. Returns numbers (iid), titles, states and branches.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
state | string | Optional | Filter by state |
per_page | integer | Optional | Results per page, up to 100 |
await setu.execute({
userId: "user_1",
action: "gitlab.list_merge_requests",
input: {
"project": "<project>"
},
});List projectsreadgitlab.list_projectsList GitLab projects, by default those the connected user is a member of. Can search by name. Returns ids and full paths.
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
membership | boolean | Optional | Only projects the user is a member of |
search | string | Optional | Match on project name, path or description |
per_page | integer | Optional | Results per page, up to 100 |
await setu.execute({
userId: "user_1",
action: "gitlab.list_projects",
input: {},
});Update issuewritegitlab.update_issueEdit an issue: change title, description or labels, or close or reopen it. Identify it by its project and issue number (iid).
Needs scope: api
| Input | Type | Description | |
|---|---|---|---|
project | string | Required | Numeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you) |
issue_iid | integer | Required | Issue number within the project (iid, not the global id) |
title | string | Optional | New title |
description | string | Optional | New description |
labels | string | Optional | Comma-separated labels; an empty string removes all |
state_event | string | Optional | close or reopen the issue |
await setu.execute({
userId: "user_1",
action: "gitlab.update_issue",
input: {
"project": "<project>",
"issue_iid": 1
},
});