gitlab_mr_get
Fetch a single merge request by project and IID to check its state, draft status, and mergeability before reviewing or merging.
Instructions
Get one merge request. Read state before anything else: only an opened merge request can be merged, and a merged one still reports merge_status can_be_merged. work_in_progress says whether it is a draft.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iid | Yes | project-scoped internal id - the number in !123 for a merge request or #123 for an issue, not the global id | |
| project | Yes | project id ('42') or full path ('group/subgroup/app'); a path is URL-encoded for you |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| iid | No | internal id - the number in !123 | |
| sha | No | HEAD of the source branch | |
| state | No | opened / closed / locked / merged | |
| title | No | ||
| author | No | user reference | |
| labels | No | ||
| web_url | No | ||
| assignee | No | user reference | |
| milestone | No | ||
| project_id | No | ||
| description | No | ||
| merge_status | No | 'can_be_merged' / 'cannot_be_merged' / 'unchecked'. A merged merge request on 11.3 still reports can_be_merged, so read state first - merge_status alone is not a green light | |
| changes_count | No | a string on 11.3, not a number | |
| has_conflicts | No | not sent by 11.3; compare merge_status instead | |
| source_branch | No | ||
| target_branch | No | ||
| merge_commit_sha | No | ||
| user_notes_count | No | ||
| work_in_progress | No | 11.3 marks a draft MR this way; the title carries a "WIP: " prefix. Verified present on every one of 100 merge requests on the live instance |