GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves time statistics for a specific merge request in a GitLab project using the GitLab API. It is useful for tracking the time spent on a merge request, which can help in project management and reporting. For example, a user can get the total time spent on a merge request to analyze productivity or estimate future tasks.

Use Case Examples

  1. Get time statistics for merge request IID 42 in project with ID 'my-group/my-project'.
  2. Fetch time tracking data for a specific merge request to monitor development progress.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Path Parameters Parameters required in the API path to specify the project and merge request.

Output

JSON

  • id - The ID of the merge request.
  • project_id - The ID of the project containing the merge request.
  • time_stats
    • time_estimate - Estimated time to complete the merge request.
    • total_time_spent - Total time spent on the merge request.
    • human_time_estimate - Human-readable format of the estimated time.
    • human_total_time_spent - Human-readable format of the total time spent.

Dependencies

  • GitLab API authentication token

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified; incorrect values will result in API errors.
  • If authentication is skipped, the request may fail due to lack of permissions.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 404 Not Found if the project or merge request does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion