doc/user/glql/functions.md
{{< details >}}
{{< /details >}}
{{< history >}}
glql_integration. Disabled by default.glql_integration removed.{{< /history >}}
Use functions with GitLab Query Language (GLQL) to create dynamic queries.
To make a query context-specific, use functions inside a query, for example, by filtering by a current user or a date.
Function name: currentUser
Parameters: None
Syntax: currentUser()
Description: Evaluates to the current authenticated user.
Additional details:
Examples:
List all issues where the current authenticated user is the assignee:
assignee = currentUser()
List all merge requests where the current authenticated user is the assignee but not the author:
type = MergeRequest and assignee = currentUser() and author != currentUser()
Function name: today
Parameters: None
Syntax: today()
Description: Evaluates to today's date at 00:00 in the user's time zone.
Additional details:
= operator, the time range is considered from 00:00 to 23:59 in the user's time zone.Examples:
List all issues created today:
created = today()
List all merge requests merged today:
type = MergeRequest and merged = today()
To derive a new column from an existing field of an embedded view, include
functions in the fields parameter.
Function name: labels
Parameters: One or more String values
Syntax: labels("field1", "field2")
Description:
The labels function takes one or more label name string values as parameter,
and creates a filtered column with only those labels on issues.
The function also works as an extractor, so if a label has been extracted, it no longer shows up
in the regular labels column, if you choose to display that column as well.
Additional details:
*) in the string to match any character.labels function.Deliverable and deliverable are equivalent.Examples:
Include all workflow scoped labels in the column:
labels("workflow::*")
Include labels Deliverable, Stretch, and Spike:
labels("Deliverable", "Stretch", "Spike")
Include all labels like backend, frontend, and others that end with end:
labels("*end")
To include the labels function in an embedded view:
```glql
display: list
fields: title, health, due, labels("workflow::*"), labels
limit: 5
query: project = "gitlab-org/gitlab" AND assignee = currentUser() AND state = opened
```