GitLab API

GitlabTool

Actions905

Overview

This node operation updates a specific merge request in a GitLab project using the GitLab API. It is useful for automating the management of merge requests, such as changing their state, updating titles, descriptions, or other attributes programmatically. For example, a user can automate the process of approving or closing merge requests based on certain conditions in their workflow.

Use Case Examples

  1. Automatically update the title or description of a merge request when certain criteria are met.
  2. Change the state of a merge request to 'merged' or 'closed' after successful CI/CD pipeline completion.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but for this operation it is PUT.
Path Parameters Parameters for the API path including project ID and merge request IID.

Output

JSON

  • id - The unique identifier of the merge request.
  • iid - The internal ID of the merge request within the project.
  • project_id - The ID of the project the merge request belongs to.
  • title - The title of the merge request.
  • description - The description of the merge request.
  • state - The 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_by - User who merged the merge request, if applicable.
  • merged_at - Timestamp when the merge request was merged, if applicable.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified; incorrect values will cause the API call to fail.
  • Authentication errors may occur if the GitLab API key is missing or invalid; verify credentials are correctly configured.
  • The API endpoint requires the HTTP PUT method; using other methods may result in errors.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.

Links

Discussion