Skip to main content

group_merge_requests

Gets or lists a group_merge_requests resource.

Overview​

Namegroup_merge_requests
TypeResource
Idgitlab.merge_requests.group_merge_requests

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringID of the merge request.
namestringName or title of the object.
project_idintegerID of the merge request project.
source_project_idintegerID of the merge request source project.
target_project_idintegerID of the merge request target project.
allow_collaborationbooleanIndicates if members of the target project can push to the fork.
allows_multiple_assigneesbooleanAllows assigning multiple users to a merge request.
allows_multiple_reviewersbooleanAllows assigning multiple reviewers to a merge request.
approvals_leftintegerNumber of approvals left.
approvals_requiredintegerNumber of approvals required.
approvedbooleanIndicates if the merge request has all the required approvals.
authorobjectMergeRequestAuthor identity (id, username, name)
auto_merge_enabledbooleanIndicates if auto merge is enabled for the merge request.
auto_merge_strategystringSelected auto merge strategy.
closed_atstringTimestamp of when the merge request was closed, null if not closed.
commit_countintegerNumber of commits in the merge request.
conflictsbooleanIndicates if the merge request has conflicts.
created_atstringTimestamp of when the merge request was created.
descriptionstringDescription of the merge request (Markdown rendered as HTML for caching).
detailed_merge_statusstringDetailed merge status of the merge request. (UNCHECKED, CHECKING, MERGEABLE, COMMITS_STATUS, CI_MUST_PASS, CI_STILL_RUNNING, DISCUSSIONS_NOT_RESOLVED, DRAFT_STATUS, NOT_OPEN, NOT_APPROVED, BLOCKED_STATUS, EXTERNAL_STATUS_CHECKS, PREPARING, JIRA_ASSOCIATION, CONFLICT, NEED_REBASE, APPROVALS_SYNCING, LOCKED_PATHS, LOCKED_LFS_FILES, MERGE_TIME, SECURITY_POLICIES_VIOLATIONS, TITLE_NOT_MATCHING, REQUESTED_CHANGES, SECURITY_POLICY_PIPELINE_CHECK)
discussion_lockedbooleanIndicates if comments on the merge request are locked to members only.
downvotesintegerNumber of downvotes for the merge request.
draftbooleanIndicates if the merge request is a draft.
force_remove_source_branchbooleanIndicates if the project settings will lead to source branch deletion after merge.
has_cibooleanIndicates if the merge request has CI.
hiddenbooleanIndicates the merge request is hidden because the author has been banned.
human_time_estimatestringHuman-readable time estimate of the merge request.
human_total_time_spentstringHuman-readable total time reported as spent on the merge request.
iidstringInternal ID of the merge request.
in_progress_merge_commit_shastringCommit SHA of the merge request if merge is in progress.
merge_afterstringDate after which the merge request can be merged.
merge_commit_shastringSHA of the merge request commit (set once merged).
merge_errorstringError message due to a merge error.
merge_ongoingbooleanIndicates if a merge is currently occurring.
merge_status_enumstringMerge status of the merge request. (UNCHECKED, CHECKING, CAN_BE_MERGED, CANNOT_BE_MERGED, CANNOT_BE_MERGED_RECHECK)
mergeablebooleanIndicates if the merge request is mergeable.
merged_atstringTimestamp of when the merge request was merged, null if not merged.
milestoneobjectMilestone identity (id, title)
prepared_atstringTimestamp of when the merge request was prepared.
projectobjectProject identity (id, full_path, name)
rebase_commit_shastringRebase commit SHA of the merge request.
referencestringInternal reference of the merge request. Returned in shortened format by default.
resolvable_discussions_countintegerNumber of user discussions that are resolvable in the merge request.
resolved_discussions_countintegerNumber of user discussions that are resolved in the merge request.
retargetedbooleanIndicates if merge request was retargeted.
should_remove_source_branchbooleanIndicates if the source branch of the merge request will be deleted after merge.
source_branchstringSource branch of the merge request.
squashbooleanIndicates if the merge request is set to be squashed when merged. [Project settings](https:​//docs.gitlab.com/user/project/merge_requests/squash_and_merge/#configure-squash-options-for-a-project) may override this value. Use squash_on_merge instead to take project squash options into account.
squash_on_mergebooleanIndicates if the merge request will be squashed when merged.
squash_read_onlybooleanIndicates if squashReadOnly is enabled.
statestringState of the merge request. (merged, opened, closed, locked, all)
supports_lock_on_mergebooleanIndicates if the merge request supports locked labels.
target_branchstringTarget branch of the merge request.
target_branch_existsbooleanIndicates if the target branch of the merge request exists.
target_branch_pathstringPath to the target branch of the merge request.
time_estimateintegerTime estimate of the merge request.
titlestringTitle of the merge request.
total_time_spentintegerTotal time (in seconds) reported as spent on the merge request.
updated_atstringTimestamp of when the merge request was last updated.
upvotesintegerNumber of upvotes for the merge request.
user_discussions_countintegerNumber of user discussions in the merge request.
user_notes_countintegerUser notes count of the merge request.
web_pathstringWeb path of the merge request.
web_urlstringWeb URL of the merge request.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfull_path, hostassignee_username, assignee_wildcard_id, author_username, closed_after, closed_before, created_after, created_before, deployed_after, deployed_before, deployment_id, draft, environment_name, include_archived, include_subgroups, merged_after, merged_before, merged_by, milestone_title, milestone_wildcard_id, my_reaction_emoji, release_tag, reviewer_username, reviewer_wildcard_id, search, sort, state, subscribed, updated_after, updated_beforeMerge requests for projects in this group. Generated from the GitLab GraphQL schema field Group.mergeRequests (connection of MergeRequest nodes).

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
full_pathstringFull path of the group, for example gitlab-org
hoststringGitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST)
assignee_usernamestringUsername of the assignee.
assignee_wildcard_idstringFilter by assignee presence. Incompatible with assigneeUsernames and assigneeUsername.
author_usernamestringUsername of the author.
closed_afterstringMerge requests closed after the date.
closed_beforestringMerge requests closed before the date.
created_afterstringMerge requests created after the timestamp.
created_beforestringMerge requests created before the timestamp.
deployed_afterstringMerge requests deployed after the timestamp.
deployed_beforestringMerge requests deployed before the timestamp.
deployment_idstringID of the deployment.
draftbooleanLimit result to draft merge requests.
environment_namestringEnvironment merge requests have been deployed to.
include_archivedbooleanReturn merge requests from archived projects
include_subgroupsbooleanInclude merge requests belonging to subgroups
merged_afterstringMerge requests merged after the date.
merged_beforestringMerge requests merged before the date.
merged_bystringUsername of the merger.
milestone_titlestringTitle of the milestone. Incompatible with milestoneWildcardId.
milestone_wildcard_idstringFilter issues by milestone ID wildcard. Incompatible with milestoneTitle.
my_reaction_emojistringFilter by your reaction emoji.
release_tagstringFilter by release tag.
reviewer_usernamestringUsername of the reviewer.
reviewer_wildcard_idstringFilter by reviewer presence. Incompatible with reviewerUsername.
sortstringSort merge requests by the criteria.
statestringMerge request state. If provided, all resolved merge requests will have the state.
subscribedstringMerge requests the current user is subscribed to.
updated_afterstringMerge requests updated after the timestamp.
updated_beforestringMerge requests updated before the timestamp.

SELECT examples​

Merge requests for projects in this group. Generated from the GitLab GraphQL schema field Group.mergeRequests (connection of MergeRequest nodes).

SELECT
id,
name,
project_id,
source_project_id,
target_project_id,
allow_collaboration,
allows_multiple_assignees,
allows_multiple_reviewers,
approvals_left,
approvals_required,
approved,
author,
auto_merge_enabled,
auto_merge_strategy,
closed_at,
commit_count,
conflicts,
created_at,
description,
detailed_merge_status,
discussion_locked,
downvotes,
draft,
force_remove_source_branch,
has_ci,
hidden,
human_time_estimate,
human_total_time_spent,
iid,
in_progress_merge_commit_sha,
merge_after,
merge_commit_sha,
merge_error,
merge_ongoing,
merge_status_enum,
mergeable,
merged_at,
milestone,
prepared_at,
project,
rebase_commit_sha,
reference,
resolvable_discussions_count,
resolved_discussions_count,
retargeted,
should_remove_source_branch,
source_branch,
squash,
squash_on_merge,
squash_read_only,
state,
supports_lock_on_merge,
target_branch,
target_branch_exists,
target_branch_path,
time_estimate,
title,
total_time_spent,
updated_at,
upvotes,
user_discussions_count,
user_notes_count,
web_path,
web_url
FROM gitlab.merge_requests.group_merge_requests
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND assignee_username = '{{ assignee_username }}'
AND assignee_wildcard_id = '{{ assignee_wildcard_id }}'
AND author_username = '{{ author_username }}'
AND closed_after = '{{ closed_after }}'
AND closed_before = '{{ closed_before }}'
AND created_after = '{{ created_after }}'
AND created_before = '{{ created_before }}'
AND deployed_after = '{{ deployed_after }}'
AND deployed_before = '{{ deployed_before }}'
AND deployment_id = '{{ deployment_id }}'
AND draft = '{{ draft }}'
AND environment_name = '{{ environment_name }}'
AND include_archived = '{{ include_archived }}'
AND include_subgroups = '{{ include_subgroups }}'
AND merged_after = '{{ merged_after }}'
AND merged_before = '{{ merged_before }}'
AND merged_by = '{{ merged_by }}'
AND milestone_title = '{{ milestone_title }}'
AND milestone_wildcard_id = '{{ milestone_wildcard_id }}'
AND my_reaction_emoji = '{{ my_reaction_emoji }}'
AND release_tag = '{{ release_tag }}'
AND reviewer_username = '{{ reviewer_username }}'
AND reviewer_wildcard_id = '{{ reviewer_wildcard_id }}'
AND search = '{{ search }}'
AND sort = '{{ sort }}'
AND state = '{{ state }}'
AND subscribed = '{{ subscribed }}'
AND updated_after = '{{ updated_after }}'
AND updated_before = '{{ updated_before }}'
;