Merge requests
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Query fields
| Field | Name (and alias) | Operators |
|---|---|---|
| Approved by user | approver, approvedBy, approvers |
=, != |
| Assignees | assignee, assignees |
=, != |
| Author | author |
=, != |
| Closed at | closed, closedAt |
=, >, <, >=, <= |
| Created at | created, createdAt, opened, openedAt |
=, >, <, >=, <= |
| Draft | draft |
=, != |
| Environment | environment |
= |
| Group | group |
= |
| ID | id |
=, in |
| Include subgroups | includeSubgroups |
=, != |
| Labels | label, labels |
=, != |
| Merged at | merged, mergedAt |
=, >, <, >=, <= |
| Merged by user | merger, mergedBy |
= |
| Milestone | milestone |
=, != |
| My reaction emoji | myReaction, myReactionEmoji |
=, != |
| Project | project |
= |
| Reviewers | reviewer, reviewers, reviewedBy |
=, != |
| Source branch | sourceBranch |
=, in, != |
| State | state |
= |
| Subscribed | subscribed |
=, != |
| Target branch | targetBranch |
=, in, != |
| Deployed at | deployed, deployedAt |
=, >, <, >=, <= |
| Updated at | updated, updatedAt |
=, >, <, >=, <= |
Approved by user
Description: Query merge requests by one or more users who approved the merge request.
Allowed value types:
StringUser(for example,@username)List(containingStringorUservalues)Nullable(either ofnull,none, orany)
Assignees
Description: Query merge requests by one or more users who are assigned to them.
Allowed value types:
StringUser(for example,@username)Nullable(either ofnull,none, orany)
Notes:
Listvalues and theinoperator are not supported for merge requests.
Author
Description: Query merge requests by their author.
Allowed value types:
StringUser(for example,@username)
Notes:
- The
inoperator is not supported for merge requests.
Closed at
Description: Query merge requests by the date when they were closed.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, the time range is considered from 00:00 to 23:59 in the user’s time zone. >=and<=operators are inclusive of the dates being queried, whereas>and<are not.
Created at
Description: Query merge requests by the date when they were created.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, the time range is considered from 00:00 to 23:59 in the user’s time zone. >=and<=operators are inclusive of the dates being queried, whereas>and<are not.
Draft
Description: Query merge requests by their draft status.
Allowed value types:
Boolean(either oftrueorfalse)
Deployed at
Description: Query merge requests by the date when they were deployed.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, the time range is considered from 00:00 to 23:59 in the user’s time zone. >=and<=operators are inclusive of the dates being queried, whereas>and<are not.
Environment
Description: Query merge requests by the environment to which they have been deployed.
Allowed value types: String
Group
Description: Query merge requests in all projects in a given group.
Allowed value types: String
Notes:
- Only one group can be queried at a time.
- The
groupcannot be used together with theprojectfield. - Using the
groupfield queries all merge requests in that group, all its subgroups, and child projects. - By default, merge requests are searched in all descendant projects across all subgroups.
To query only the direct child projects of the group, set the
includeSubgroupsfield tofalse.
ID
Description: Query merge requests by their IDs.
Allowed value types:
Number(only positive integers)List(containingNumbervalues)
Include subgroups
Description: Query merge requests in the entire hierarchy of a group.
Allowed value types:
Boolean(either oftrueorfalse)
Notes:
- This field can only be used with the
groupfield. - The value of this field defaults to
false.
Labels
Description: Query merge requests by their associated labels.
Allowed value types:
StringLabel(for example,~bug,~"team::planning")Nullable(either ofnone, orany)
Notes:
- The
inoperator is not supported for merge requests. - Scoped labels, or labels containing spaces must be wrapped in quotes.
Merged at
Description: Query merge requests by the date when they were merged.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, the time range is considered from 00:00 to 23:59 in the user’s time zone. >=and<=operators are inclusive of the dates being queried, whereas>and<are not.
Merged by user
Description: Query merge requests by the user that merged the merge request.
Allowed value types:
StringUser(for example,@username)
Milestone
Description: Query merge requests by their associated milestone.
Allowed value types:
StringMilestone(for example,%Backlog,%"Awaiting Further Demand")Nullable(either ofnone, orany)
Notes:
- The
inoperator is not supported for merge requests. - Milestones containing spaces must be wrapped in quotes (
").
My reaction emoji
Description: Query merge requests by the current user’s emoji reaction on it.
Allowed value types: String
Project
Description: Query merge requests in a particular project.
Allowed value types: String
Notes:
- Only one project can be queried at a time.
- The
projectfield cannot be used together with thegroupfield. - If omitted when using inside an embedded view,
projectis assumed to be the current project.
Reviewers
Description: Query merge requests that were reviewed by one or more users.
Allowed value types:
StringUser(for example,@username)Nullable(either ofnull,none, orany)
Source branch
Description: Query merge requests by their source branch.
Allowed value types: String, List
Notes:
Listvalues are only supported with theinand!=operators.
State
Description: Query merge requests by state.
Allowed value types:
Enum, one ofopened,closed,merged, orall
Notes:
- The
statefield does not support the!=operator.
Subscribed
Description: Query merge requests by whether the current user has set notifications on or off.
Allowed value types: Boolean
Target branch
Description: Query merge requests by their target branch.
Allowed value types: String, List
Notes:
Listvalues are only supported with theinand!=operators.
Updated at
Description: Query merge requests by when they were last updated.
Allowed value types:
AbsoluteDate(in the formatYYYY-MM-DD)RelativeDate(in the format<sign><digit><unit>, where sign is+,-, or omitted, digit is an integer, andunitis one ofd(days),w(weeks),m(months) ory(years))
Notes:
- For the
=operator, the time range is considered from 00:00 to 23:59 in the user’s time zone. >=and<=operators are inclusive of the dates being queried, whereas>and<are not.
Display fields
| Field | Name or alias | Description |
|---|---|---|
| Approved by user | approver, approvers, approvedBy |
Display users who approved the merge request |
| Assignees | assignee, assignees |
Display users assigned to the merge request |
| Author | author |
Display the author of the merge request |
| Closed at | closed, closedAt |
Display time since the merge request was closed |
| Created at | created, createdAt |
Display time since the merge request was created |
| Deployed at | deployed, deployedAt |
Display time since the merge request was deployed |
| Description | description |
Display the description of the merge request |
| Draft | draft |
Display Yes or No indicating whether the merge request is in draft state |
| ID | id |
Display the ID of the merge request |
| Labels | label, labels |
Display labels associated with the merge request |
| Last comment | lastComment |
Display the last comment made on the merge request |
| Merged at | merged, mergedAt |
Display time since the merge request was merged |
| Milestone | milestone |
Display the milestone associated with the merge request |
| Reviewers | reviewer, reviewers |
Display users assigned to review the merge request |
| Source branch | sourceBranch |
Display the source branch of the merge request |
| Source project | sourceProject |
Display the source project of the merge request |
| State | state |
Display a badge indicating the state. Values are Open, Closed, or Merged |
| Subscribed | subscribed |
Display Yes or No indicating whether the current user is subscribed |
| Target branch | targetBranch |
Display the target branch of the merge request |
| Target project | targetProject |
Display the target project of the merge request |
| Title | title |
Display the title of the merge request |
| Updated at | updated, updatedAt |
Display time since the merge request was last updated |
Sort fields
| Field | Name (and alias) | Description |
|---|---|---|
| Closed at | closed, closedAt |
Sort by closed date |
| Created | created, createdAt |
Sort by created date |
| Merged at | merged, mergedAt |
Sort by merge date |
| Milestone | milestone |
Sort by milestone due date |
| Popularity | popularity |
Sort by the number of thumbs up emoji reactions |
| Title | title |
Sort by title |
| Updated at | updated, updatedAt |
Sort by last updated date |
Examples:
-
List all merge requests in the
gitlab-orggroup created by me sorted by the merge date (latest first):```glql display: table fields: title, reviewer, merged sort: merged desc query: group = "gitlab-org" and type = MergeRequest and state = merged and author = currentUser() limit: 10 ```