GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to add spent time to a specific merge request in a GitLab project via the GitLab API. It is useful for tracking time spent on code reviews or merge request tasks directly within GitLab projects. For example, a developer or project manager can log hours spent on a merge request to maintain accurate project time tracking.

Use Case Examples

  1. Adding 2 hours of spent time to a merge request with internal ID 15 in project with ID 'my-group/my-project'.
  2. Logging time spent on a merge request to keep project time tracking up to date.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication The authentication method used for the API request, typically a GitLab API key.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, default is GET but can be POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters used in the API request path to specify the project and merge request.

Output

JSON

  • time_spent - The amount of time added as spent time on the merge request.
  • merge_request_id - The internal ID of the merge request to which time was added.
  • project_id - The ID of the project containing the merge request.
  • message - Response message from the API indicating success or failure of the time addition.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request internal ID are correct and exist in the GitLab instance.
  • Verify that the API key used for authentication has sufficient permissions to add spent time to merge requests.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include authentication failures, invalid project or merge request IDs, and insufficient permissions. Resolving these typically involves correcting credentials, IDs, or permissions.

Links

Discussion