gitlab_mr_create
Create a GitLab merge request from a source branch into a target branch, with optional draft status, labels, assignee, and squash settings.
Instructions
Create a merge request from source_branch into target_branch. On 11.3 there is no reviewers attribute (assign instead) and no draft parameter: pass draft:true and the required "WIP: " title prefix is applied for you. Creating an MR whose branches already have an open one fails with 409 - update that one instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | mark as work in progress ("WIP: " title prefix) | |
| title | Yes | ||
| labels | No | label names; a label that does not exist yet is created by GitLab when the caller has permission | |
| squash | No | squash commits when this MR merges | |
| project | Yes | project id ('42') or full path ('group/subgroup/app'); a path is URL-encoded for you | |
| assignee_id | No | assignee numeric user id (find it with gitlab_users_search); 0 unassigns | |
| description | No | GitLab Flavored Markdown | |
| milestone_id | No | global milestone id, not the project-scoped iid | |
| source_branch | Yes | branch name, e.g. feature/login | |
| target_branch | Yes | ||
| remove_source_branch | No | remove the source branch when this MR merges |
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 |