GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves detailed information about a specific merge request in a GitLab project using the GitLab API v4. It is useful for scenarios where you need to programmatically access merge request data, such as in CI/CD pipelines, project management automation, or reporting tools. For example, you can fetch the status, description, and commit details of a merge request to automate review workflows or generate custom notifications.

Use Case Examples

  1. Fetch merge request details to check if it is ready to be merged.
  2. Retrieve merge request information including rendered HTML for better display in dashboards.
  3. Get the count of commits behind the target branch to assess merge conflicts.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is GET.
Parameter Schema Defines the required and optional parameters for the API call, including project ID, merge request internal ID, and optional query parameters for rendering HTML, including diverged commits count, and rebase status.
Query Parameters Optional query parameters to customize the response, such as rendering HTML, including diverged commits count, and rebase in progress status.
Path Parameters Path parameters specifying the project ID and the internal ID of the merge request to retrieve.

Output

JSON

  • id - The unique identifier of the merge request.
  • title - The title of the merge request.
  • description - The description of the merge request, optionally rendered as HTML.
  • state - The current state of the merge request (e.g., opened, closed, merged).
  • author - Information about the user who created the merge request.
  • commits_count - The number of commits in the merge request.
  • diverged_commits_count - The number of commits behind the target branch, if requested.
  • rebase_in_progress - Indicates if a rebase operation is in progress, if requested.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and merge request internal ID are correct and URL-encoded if necessary.
  • Check that the API authentication token has sufficient permissions to access the project and merge request.
  • If the response is empty or incomplete, verify the optional query parameters are correctly formatted as booleans.
  • Network issues or incorrect base URL can cause connection failures; verify the base URL is correct and accessible.

Links

Discussion