doc/user/glql/data_sources/merge_requests.md
{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
| 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 | =, >, <, >=, <= |
{{< history >}}
approvedBy and approvers introduced in GitLab 18.0.Nullable values introduced in GitLab 18.3.{{< /history >}}
Description: Query merge requests by one or more users who approved the merge request.
Allowed value types:
StringUser (for example, @username)List (containing String or User values)Nullable (either of null, none, or any)Description: Query merge requests by one or more users who are assigned to them.
Allowed value types:
StringUser (for example, @username)Nullable (either of null, none, or any)Notes:
List values and the in operator are not supported for merge requests.Description: Query merge requests by their author.
Allowed value types:
StringUser (for example, @username)Notes:
in operator is not supported for merge requests.Description: Query merge requests by the date when they were closed.
Allowed value types:
AbsoluteDate (in the format YYYY-MM-DD)RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted,
digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))Notes:
= 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.Description: Query merge requests by the date when they were created.
Allowed value types:
AbsoluteDate (in the format YYYY-MM-DD)RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted,
digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))Notes:
= 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.{{< history >}}
{{< /history >}}
Description: Query merge requests by their draft status.
Allowed value types:
Boolean (either of true or false)Description: Query merge requests by the date when they were deployed.
Allowed value types:
AbsoluteDate (in the format YYYY-MM-DD)RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted,
digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))Notes:
= 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.{{< history >}}
{{< /history >}}
Description: Query merge requests by the environment to which they have been deployed.
Allowed value types: String
Description: Query merge requests in all projects in a given group.
Allowed value types: String
Notes:
group cannot be used together with the project field.group field queries all merge requests in that group, all its subgroups, and child projects.includeSubgroups field to false.Description: Query merge requests by their IDs.
Allowed value types:
Number (only positive integers)List (containing Number values)Description: Query merge requests in the entire hierarchy of a group.
Allowed value types:
Boolean (either of true or false)Notes:
group field.false.Description: Query merge requests by their associated labels.
Allowed value types:
StringLabel (for example, ~bug, ~"team::planning")Nullable (either of none, or any)Notes:
in operator is not supported for merge requests.{{< history >}}
mergedAt introduced in GitLab 18.0.>= and <= introduced in GitLab 18.0.{{< /history >}}
Description: Query merge requests by the date when they were merged.
Allowed value types:
AbsoluteDate (in the format YYYY-MM-DD)RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted,
digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))Notes:
= 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.{{< history >}}
mergedBy introduced in GitLab 18.0.{{< /history >}}
Description: Query merge requests by the user that merged the merge request.
Allowed value types:
StringUser (for example, @username)Description: Query merge requests by their associated milestone.
Allowed value types:
StringMilestone (for example, %Backlog, %"Awaiting Further Demand")Nullable (either of none, or any)Notes:
in operator is not supported for merge requests.").Description: Query merge requests by the current user's emoji reaction on it.
Allowed value types: String
Description: Query merge requests in a particular project.
Allowed value types: String
Notes:
project field cannot be used together with the group field.project is assumed to be the current project.{{< history >}}
reviewers and reviewedBy introduced in GitLab 18.0.{{< /history >}}
Description: Query merge requests that were reviewed by one or more users.
Allowed value types:
StringUser (for example, @username)Nullable (either of null, none, or any){{< history >}}
{{< /history >}}
Description: Query merge requests by their source branch.
Allowed value types: String, List
Notes:
List values are only supported with the in and != operators.Description: Query merge requests by state.
Allowed value types:
Enum, one of opened, closed, merged, or allNotes:
state field does not support the != operator.Description: Query merge requests by whether the current user has set notifications on or off.
Allowed value types: Boolean
{{< history >}}
{{< /history >}}
Description: Query merge requests by their target branch.
Allowed value types: String, List
Notes:
List values are only supported with the in and != operators.Description: Query merge requests by when they were last updated.
Allowed value types:
AbsoluteDate (in the format YYYY-MM-DD)RelativeDate (in the format <sign><digit><unit>, where sign is +, -, or omitted,
digit is an integer, and unit is one of d (days), w (weeks), m (months) or y (years))Notes:
= 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.{{< history >}}
sourceBranch, targetBranch, sourceProject, and targetProject introduced in GitLab 18.2.{{< /history >}}
| 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 |
| 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-org group 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
```