GitLab API

GitlabTool

Actions905

Overview

This node operation fetches merge requests from the GitLab API (v4) using various query parameters to filter and customize the results. It is useful for retrieving detailed information about merge requests in GitLab projects, such as those created by specific users, assigned to certain users, filtered by labels, milestones, states, and other criteria. Practical examples include automating project management workflows, monitoring merge request statuses, or integrating GitLab merge request data into other systems.

Use Case Examples

  1. Retrieve all open merge requests assigned to a specific user.
  2. Fetch merge requests created by a particular author within a date range.
  3. Get merge requests filtered by labels and sorted by creation date.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
baseUrl The base URL of the GitLab instance to connect to, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, default is GET.
Query Parameters Collection of optional query parameters to filter and customize the merge requests returned by the API, such as author_id, assignee_id, labels, state, created_after, updated_before, scope, and pagination options.

Output

JSON

  • id - Unique identifier of the merge request.
  • iid - Internal ID of the merge request within the project.
  • project_id - ID of the project the merge request belongs to.
  • title - Title of the merge request.
  • description - Description of the merge request.
  • state - Current state of the merge request (e.g., opened, closed, merged).
  • created_at - Timestamp when the merge request was created.
  • updated_at - Timestamp when the merge request was last updated.
  • merged_at - Timestamp when the merge request was merged, if applicable.
  • labels - Labels associated with the merge request.
  • author - Information about the author of the merge request.
  • assignee - Information about the assignee of the merge request.
  • reviewers - List of reviewers for the merge request.
  • merge_status - Current merge status of the merge request.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the GitLab API credentials are correctly configured and have sufficient permissions to access merge requests.
  • Verify the baseUrl is correct and accessible from the n8n instance.
  • Check that query parameters are valid and conform to GitLab API specifications to avoid request errors.
  • Common error messages include authentication failures, invalid query parameters, or rate limiting by the GitLab API. Resolving these involves verifying credentials, correcting parameter values, and respecting API rate limits.

Links

Discussion