Skip to main content
Triggers a workflow on every new merge in a given repository and a target branch. The target branch defaults to the main/master branch. Endpoint: https://gitlab.com/api/v4/projects/{id}/merge_requests
Workflows with this trigger check for new events every 5 minutes by default. You can adjust this interval in the Trigger settings.

Basic Parameters

ParameterDescription
Project IDThe ID or path of the project owned by the authenticated user. If the path is being used, it should be url encoded - for example: user%2my-project .

Advanced Parameters

ParameterDescription
Target BranchReturn merge requests with the given target branch.

Sample Event

{
	"id": 152894464,
	"iid": 5,
	"project_id": 29156940,
	"title": "v1.0.0",
	"description": "",
	"state": "merged",
	"created_at": "2022-04-29T15:13:56.388Z",
	"updated_at": "2022-04-29T15:14:26.410Z",
	"merged_by": {
		"id": 7476674,
		"username": "johndoe22",
		"name": "John Doe",
		"state": "active",
		"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/7476674/avatar.png",
		"web_url": "https://gitlab.com/johndoe22"
	},
	"merge_user": {
		"id": 7476674,
		"username": "johndoe22",
		"name": "John Doe",
		"state": "active",
		"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/7476674/avatar.png",
		"web_url": "https://gitlab.com/johndoe22"
	},
	"merged_at": "2022-04-29T15:14:26.488Z",
	"closed_by": null,
	"closed_at": null,
	"target_branch": "main",
	"source_branch": "Feature/v1.0.0",
	"user_notes_count": 0,
	"upvotes": 0,
	"downvotes": 0,
	"author": {
		"id": 7476674,
		"username": "johndoe22",
		"name": "John Doe",
		"state": "active",
		"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/7476674/avatar.png",
		"web_url": "https://gitlab.com/johndoe22"
	},
	"assignees": [
		{
			"id": 7476674,
			"username": "johndoe22",
			"name": "John Doe",
			"state": "active",
			"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/7476674/avatar.png",
			"web_url": "https://gitlab.com/johndoe22"
		}
	],
	"assignee": {
		"id": 7476674,
		"username": "johndoe22",
		"name": "John Doe",
		"state": "active",
		"avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/7476674/avatar.png",
		"web_url": "https://gitlab.com/johndoe22"
	},
	"reviewers": [],
	"source_project_id": 29156940,
	"target_project_id": 29156940,
	"labels": [],
	"draft": false,
	"work_in_progress": false,
	"milestone": null,
	"merge_when_pipeline_succeeds": false,
	"merge_status": "can_be_merged",
	"sha": "6c4252cdd87cbcdf6a981ccf0c5540d64008ff50",
	"merge_commit_sha": "2cb79a41ced6b1c7738579b933f043377228ff42",
	"squash_commit_sha": null,
	"discussion_locked": null,
	"should_remove_source_branch": null,
	"force_remove_source_branch": false,
	"reference": "!5",
	"references": {
		"short": "!5",
		"relative": "!5",
		"full": "mono_ido_programming/ashdod-801-neat_ecosystems!5"
	},
	"web_url": "https://gitlab.com/mono_ido_programming/ashdod-801-neat_ecosystems/-/merge_requests/5",
	"time_stats": {
		"time_estimate": 0,
		"total_time_spent": 0,
		"human_time_estimate": null,
		"human_total_time_spent": null
	},
	"squash": false,
	"task_completion_status": {
		"count": 0,
		"completed_count": 0
	},
	"has_conflicts": false,
	"blocking_discussions_resolved": true,
	"approvals_before_merge": null
}