Setu Recipes: reusable workflows across every app.Browse templates

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

TypeScript
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

ScopeWhy it is requested
apiRead 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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
titlestringRequiredIssue title
descriptionstringOptionalIssue description (Markdown)
labelsstringOptionalComma-separated label names
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
issue_iidintegerRequiredIssue number within the project (iid)
bodystringRequiredComment text (Markdown)
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
merge_request_iidintegerRequiredMerge request number within the project (iid)
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
statestringOptionalWhich issues
labelsstringOptionalComma-separated label names; issues must have all of them
searchstringOptionalMatch in title and description
per_pageintegerOptionalResults per page, up to 100
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
statestringOptionalFilter by state
per_pageintegerOptionalResults per page, up to 100
TypeScript
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

InputTypeDescription
membershipbooleanOptionalOnly projects the user is a member of
searchstringOptionalMatch on project name, path or description
per_pageintegerOptionalResults per page, up to 100
TypeScript
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

InputTypeDescription
projectstringRequiredNumeric project id, or the full path such as diaspora/diaspora-project-site (encoded for you)
issue_iidintegerRequiredIssue number within the project (iid, not the global id)
titlestringOptionalNew title
descriptionstringOptionalNew description
labelsstringOptionalComma-separated labels; an empty string removes all
state_eventstringOptionalclose or reopen the issue
TypeScript
await setu.execute({
  userId: "user_1",
  action: "gitlab.update_issue",
  input: {
    "project": "<project>",
    "issue_iid": 1
  },
});