Work items

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Work items include the types: Issue, Incident, TestCase, Requirement, Task, Ticket, Objective, KeyResult, and Epic.

Querying epics is available only on the Premium and Ultimate tier.

Query fields

FieldName (and alias)OperatorsTypes
Assigneesassignee, assignees=, in, !=All
Authorauthor=, in, !=All
Cadencecadence=, inAll except Epic
Closed atclosed, closedAt=, >, <, >=, <=All
Confidentialconfidential=, !=All
Created atcreated, createdAt, opened, openedAt=, >, <, >=, <=All
Custom fieldcustomField("Field name")=All
Due datedue, dueDate=, >, <, >=, <=All
Epicepic=, !=All except Epic
Groupgroup=All
Health statushealth, healthStatus=, !=All
IDid=, inAll
Include subgroupsincludeSubgroups=, !=All
Iterationiteration=, in, !=All except Epic
Labelslabel, labels=, in, !=All
Milestonemilestone=, in, !=All
My reaction emojimyReaction, myReactionEmoji=, !=All
Parentparent=, !=All except Epic
Projectproject=All except Epic
Statestate=All
Statusstatus=All except Epic
Subscribedsubscribed=, !=All
Updated atupdated, updatedAt=, >, <, >=, <=All
Weightweight=, !=All except Epic

Assignees

Description: Query work items by one or more users who are assigned to them.

Allowed value types:

  • String
  • User (for example, @username)
  • List (containing String or User values)
  • Nullable (either of null, none, or any)

Author

Description: Query work items by their author.

Allowed value types:

  • String
  • User (for example, @username)
  • List (containing String or User values)

Cadence

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:

  • Because a work item can have only one iteration, the = operator cannot be used with List type for the cadence field.

Closed at

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:

  • 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.

Confidential

Description: Query work items by their visibility to project members.

Allowed value types:

  • Boolean (either of true or false)

Notes:

  • Confidential work items queried using GLQL are only visible to people who have permission to view them.

Created at

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:

  • 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.

Custom field

  • Tier: Premium, Ultimate

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:

  • Custom field names and values are not case-sensitive.

Due date

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:

  • 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.

Epic

  • Tier: Premium, Ultimate

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)

Group

Description: Query work items in all projects in a given group.

Allowed value types: String

Notes:

  • Only one group can be queried at a time.
  • The group cannot be used together with the project field.
  • If omitted when using inside an embedded view in a group object (like an epic), group is assumed to be the current group.
  • Using the group field queries all objects in that group, all its subgroups, and child projects.
  • By default, work items are searched in all descendant projects across all subgroups. To query only the direct child projects of the group, set the includeSubgroups field to false.

Health status

  • Tier: Ultimate

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)

ID

Description: Query work items by their IDs.

Allowed value types:

  • Number (only positive integers)
  • List (containing Number values)

Include subgroups

Description: Query work items in the entire hierarchy of a group.

Allowed value types:

  • Boolean (either of true or false)

Notes:

  • This field can only be used with the group field.
  • The value of this field defaults to false.

Iteration

  • Tier: Premium, Ultimate

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:

  • Because a work item can have only one iteration, the = operator cannot be used with List type for the iteration field.

Labels

Description: Query work items by their associated labels.

Allowed value types:

  • String
  • Label (for example, ~bug, ~"team::planning")
  • List (containing String or Label values)
  • Nullable (either of none, or any)

Notes:

  • Scoped labels, or labels containing spaces must be wrapped in quotes.

Milestone

Description: Query work items by their associated milestone.

Allowed value types:

  • String
  • Milestone (for example, %Backlog, %"Awaiting Further Demand")
  • List (containing String or Milestone values)
  • Nullable (either of none, or any)

Notes:

  • Milestones containing spaces must be wrapped in quotes (").
  • Because a work item can have only one milestone, the = operator cannot be used with List type for the milestone field.
  • The Epic type does not support wildcard milestone filters like none or any.

My reaction emoji

Description: Query work items by the current user’s emoji reaction on it.

Allowed value types: String

Parent

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)

Project

Description: Query work items, except epics, in a particular project.

Allowed value types: String

Notes:

  • Only one project can be queried at a time.
  • The project field cannot be used together with the group field.
  • If omitted when using inside an embedded view, project is assumed to be the current project.

State

Description: Query work items by state.

Allowed value types:

  • Enum, one of opened, closed, or all

Notes:

  • The state field does not support the != operator.

Status

  • Tier: Premium, Ultimate

Description: Query work items by their status.

Allowed value types: String

Subscribed

Description: Query work items by whether the current user has set notifications on or off.

Allowed value types: Boolean

Updated at

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:

  • 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.

Weight

  • Tier: Premium, Ultimate

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:

  • Comparison operators < and > cannot be used.

Display fields

FieldName or aliasTypesDescription
Assigneesassignee, assigneesAllDisplay users assigned to the object
AuthorauthorAllDisplay the author of the object
Closed atclosed, closedAtAllDisplay time since the object was closed
ConfidentialconfidentialAllDisplay Yes or No indicating whether the object is confidential
Created atcreated, createdAtAllDisplay time since the object was created
DescriptiondescriptionAllDisplay the description of the object
Due datedue, dueDateAllDisplay time until the object is due
EpicepicAll except EpicDisplay a link to the epic. Available in the Premium and Ultimate tier
Health statushealth, healthStatusAllDisplay a badge indicating the health status. Available in the Ultimate tier
IDidAllDisplay the ID of the object
IterationiterationAll except EpicDisplay the iteration. Available in the Premium and Ultimate tier
Labelslabel, labelsAllDisplay labels. Can accept parameters to filter specific labels, for example labels("workflow::*", "backend")
Last commentlastCommentAllDisplay the last comment made on the object
MilestonemilestoneAllDisplay the milestone associated with the object
Start datestart, startDateEpic onlyDisplay the start date of the epic
StatestateAllDisplay a badge indicating the state. Values are Open or Closed
StatusstatusAll except EpicDisplay a badge indicating the status. For example, “To do” or “Complete”. Available in the Premium and Ultimate tiers
SubscribedsubscribedAllDisplay Yes or No indicating whether the current user is subscribed
TitletitleAllDisplay the title of the object
TypetypeAllDisplay the work item type, for example Issue, Task, or Objective
Updated atupdated, updatedAtAllDisplay time since the object was last updated
WeightweightAll except EpicDisplay the weight. Available in the Premium and Ultimate tiers

Sort fields

FieldName (and alias)TypesDescription
Closed atclosed, closedAtAllSort by closed date
Createdcreated, createdAtAllSort by created date
Due datedue, dueDateAllSort by due date
Health statushealth, healthStatusAllSort by health status
MilestonemilestoneAll except EpicSort by milestone due date
PopularitypopularityAllSort by the number of thumbs up emoji reactions
Start datestart, startDateEpic onlySort by start date
TitletitleAllSort by title
Updated atupdated, updatedAtAllSort by last updated date
WeightweightAll except EpicSort by weight

Examples:

  • 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
    ```