doc/user/glql/data_sources/work_items.md
{{< details >}}
{{< /details >}}
Work items include the types:
Issue, Incident, TestCase, Requirement, Task, Ticket, Objective, KeyResult, and Epic.
[!note] Querying epics is available only on the Premium and Ultimate tier.
| Scope | Description |
|---|---|
project | Query work items in a specific project. |
group | Query work items across all projects in a group, including subgroups. |
For more information, see scopes.
| Field | Name (and alias) | Operators | Types |
|---|---|---|---|
| Assignees | assignee, assignees | =, in, != | All |
| Author | author | =, in, != | All |
| Cadence | cadence | =, in | All except Epic |
| Closed at | closed, closedAt | =, >, <, >=, <= | All |
| Confidential | confidential | =, != | All |
| Created at | created, createdAt, opened, openedAt | =, >, <, >=, <= | All |
| Custom field | customField("Field name") | = | All |
| Due date | due, dueDate | =, >, <, >=, <= | All |
| Epic | epic | =, != | All except Epic |
| Health status | health, healthStatus | =, != | All |
| ID | id | =, in | All |
| Include subgroups | includeSubgroups | =, != | All |
| Iteration | iteration | =, in, != | All except Epic |
| Labels | label, labels | =, in, != | All |
| Milestone | milestone | =, in, != | All |
| My reaction emoji | myReaction, myReactionEmoji | =, != | All |
| Parent | parent | =, != | All except Epic |
| State | state | = | All |
| Status | status | = | All except Epic |
| Subscribed | subscribed | =, != | All |
| Updated at | updated, updatedAt | =, >, <, >=, <= | All |
| Weight | weight | =, != | All except Epic |
{{< history >}}
assignees introduced in GitLab 18.0.{{< /history >}}
Description: Query work items by one or more users who are assigned to them.
Allowed value types:
StringUser (for example, @username)List (containing String or User values)Nullable (either of null, none, or any){{< history >}}
in operator introduced in GitLab 18.3.{{< /history >}}
Description: Query work items by their author.
Allowed value types:
StringUser (for example, @username)List (containing String or User values){{< history >}}
{{< /history >}}
Description: Query work items except epics by the cadence that the work item's iteration is a part of.
Allowed value types:
Number (only positive integers)List (containing Number values)Nullable (either of none, or any)Notes:
= operator cannot be used with List type for the cadence field.{{< history >}}
closedAt introduced in GitLab 18.0.>= and <= introduced in GitLab 18.0.{{< /history >}}
Description: Query work items 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.{{< history >}}
{{< /history >}}
Description: Query work items by their visibility to project members.
Allowed value types:
Boolean (either of true or false)Notes:
{{< history >}}
createdAt, opened, and openedAt introduced in GitLab 18.0.>= and <= introduced in GitLab 18.0.{{< /history >}}
Description: Query work items 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.{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Description: Query work items by custom fields.
Allowed value types:
String (for single-select custom fields)List (of String, for multi-select custom fields)Notes:
{{< history >}}
dueDate introduced in GitLab 18.0.>= and <= introduced in GitLab 18.0.{{< /history >}}
Description: Query work items by the date when they are due.
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.{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Description: Query work items by their parent epic ID or reference.
Allowed value types:
Number (epic ID)String (containing an epic reference like &123)Epic (for example, &123, gitlab-org&123){{< details >}}
{{< /details >}}
{{< history >}}
healthStatus introduced in GitLab 18.0.{{< /history >}}
Description: Query work items by their health status.
Allowed value types:
StringEnum (one of "needs attention", "at risk" or "on track")Nullable (either of null, none, or any){{< history >}}
{{< /history >}}
Description: Query work items by their IDs.
Allowed value types:
Number (only positive integers)List (containing Number values){{< history >}}
{{< /history >}}
Description: Query work items in the entire hierarchy of a group.
Allowed value types:
Boolean (either of true or false)Notes:
group scope.false.{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Description: Query work items, except epics, by their associated iteration.
Allowed value types:
Number (only positive integers)Iteration (for example, *iteration:123456)List (containing Number or Iteration values)Enum (only current is supported)Nullable (either of none, or any)Notes:
= operator cannot be used with List type for the iteration field.{{< history >}}
labels introduced in GitLab 18.0.{{< /history >}}
Description: Query work items by their associated labels.
Allowed value types:
StringLabel (for example, ~bug, ~"team::planning")List (containing String or Label values)Nullable (either of none, or any)Notes:
{{< history >}}
{{< /history >}}
Description: Query work items by their associated milestone.
Allowed value types:
StringMilestone (for example, %Backlog, %"Awaiting Further Demand")List (containing String or Milestone values)Nullable (either of none, or any)Notes:
").= operator cannot be used with List type for the milestone field.Epic type does not support wildcard milestone filters like none or any.{{< history >}}
{{< /history >}}
Description: Query work items by the current user's emoji reaction on it.
Allowed value types: String
Description: Query work items, except epics, by their parent work item or epic.
Allowed value types:
Number (parent ID)String (containing a reference like #123)WorkItem (for example, #123, gitlab-org/gitlab#123)Epic (for example, &123, gitlab-org&123){{< history >}}
{{< /history >}}
Description: Query work items by state.
Allowed value types:
Enum, one of opened, closed, or allNotes:
state field does not support the != operator.{{< details >}}
{{< /details >}}
{{< history >}}
{{< /history >}}
Description: Query work items by their status.
Allowed value types: String
{{< history >}}
{{< /history >}}
Description: Query work items by whether the current user has set notifications on or off.
Allowed value types: Boolean
{{< history >}}
updatedAt introduced in GitLab 18.0.>= and <= introduced in GitLab 18.0.{{< /history >}}
Description: Query work items 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.{{< details >}}
{{< /details >}}
Description: Query work items, except epics, by their weight.
Allowed value types:
Number (only positive integers or 0)Nullable (either of null, none, or any)Notes:
< and > cannot be used.{{< history >}}
iteration introduced in GitLab 17.6.lastComment introduced in GitLab 17.11.status introduced in GitLab 18.2.health and type in epics introduced in GitLab 18.3.{{< /history >}}
| Field | Name or alias | Types | Description |
|---|---|---|---|
| Assignees | assignee, assignees | All | Display users assigned to the object |
| Author | author | All | Display the author of the object |
| Closed at | closed, closedAt | All | Display time since the object was closed |
| Color | color | Epic only | Display the color swatch associated with the epic |
| Confidential | confidential | All | Display Yes or No indicating whether the object is confidential |
| Created at | created, createdAt | All | Display time since the object was created |
| Description | description | All | Display the description of the object |
| Due date | due, dueDate | All | Display time until the object is due |
| Epic | epic | All except Epic | Display a link to the epic. Available in the Premium and Ultimate tier |
| Health status | health, healthStatus | All | Display a badge indicating the health status. Available in the Ultimate tier |
| ID | id | All | Display the ID of the object |
| Iteration | iteration | All except Epic | Display the iteration. Available in the Premium and Ultimate tier |
| Labels | label, labels | All | Display labels. Can accept parameters to filter specific labels, for example labels("workflow::*", "backend") |
| Last comment | lastComment | All | Display the last comment made on the object |
| Milestone | milestone | All | Display the milestone associated with the object |
| Parent | parent | All | Display a link to the parent work item or epic |
| Progress | progress | Objective and Key Result only | Display the progress percentage (0–100) of the work item |
| Project | project | All except Epic | Display the project the work item belongs to |
| Start date | start, startDate | Epic only | Display the start date of the epic |
| State | state | All | Display a badge indicating the state. Values are Open or Closed |
| Status | status | All except Epic | Display a badge indicating the status. For example, "To do" or "Complete". Available in the Premium and Ultimate tiers |
| Task completion status | taskCompletionStatus | All | Display task completion as a fraction (completed/total) |
| Time estimate | timeEstimate | All | Display the estimated time for the work item |
| Title | title | All | Display the title of the object |
| Total time spent | totalTimeSpent | All | Display the total time spent on the work item |
| Type | type | All | Display the work item type, for example Issue, Task, or Objective |
| Updated at | updated, updatedAt | All | Display time since the object was last updated |
| Weight | weight | All except Epic | Display the weight. Available in the Premium and Ultimate tiers |
{{< history >}}
{{< /history >}}
| Field | Name (and alias) | Types | Description |
|---|---|---|---|
| Closed at | closed, closedAt | All | Sort by closed date |
| Created | created, createdAt | All | Sort by created date |
| Due date | due, dueDate | All | Sort by due date |
| Health status | health, healthStatus | All | Sort by health status |
| Milestone | milestone | All except Epic | Sort by milestone due date |
| Popularity | popularity | All | Sort by the number of thumbs up emoji reactions |
| Start date | start, startDate | Epic only | Sort by start date |
| Title | title | All | Sort by title |
| Updated at | updated, updatedAt | All | Sort by last updated date |
| Weight | weight | All except Epic | Sort by weight |
List all issues in the gitlab-org/gitlab project sorted by title:
```glql
display: table
fields: state, title, updated
sort: title asc
query: project = "gitlab-org/gitlab" and type = Issue
```
List all epics in the gitlab-org group sorted by the start date (oldest first):
```glql
display: table
fields: title, state, startDate
sort: startDate asc
query: group = "gitlab-org" and type = Epic
```
List all issues in the gitlab-org group with an assigned weight sorted by
the weight (highest first):
```glql
display: table
fields: title, weight, health
sort: weight desc
query: type = Issue and group = "gitlab-org" and weight = any
```
List all issues in the gitlab-org group due up to a week from today sorted by the due
date (earliest first):
```glql
display: table
fields: title, dueDate, assignee
sort: dueDate asc
query: type = Issue and group = "gitlab-org" and due >= today() and due <= 1w
```