kolaente
dbfe162cd2
Some checks reported errors
continuous-integration/drone/push Build was killed
Previously, when creating a filter query with the 'in' operator and multiple values, autocompletion and highlighting was not available. This change now implements a split for each value, seperated by a comma.
2.2 KiB
2.2 KiB
title | date | draft | type | menu | ||||
---|---|---|---|---|---|---|---|---|
Filters | 2024-03-09T19:51:32+02:00 | false | doc |
|
Filter Syntax
To filter tasks via the api, you can use a query syntax similar to SQL.
This document is about filtering via the api. To filter in Vikunja's web ui, check out the help text below the filter query input.
{{< table_of_contents >}}
Available fields
The available fields for filtering include:
done
: Whether the task is completed or notpriority
: The priority level of the task (1-5)percentDone
: The percentage of completion for the task (0-100)dueDate
: The due date of the taskstartDate
: The start date of the taskendDate
: The end date of the taskdoneAt
: The date and time when the task was completedassignees
: The assignees of the tasklabels
: The labels associated with the taskproject
: The project the task belongs to (only available for saved filters, not on a project level)
You can date math to set relative dates. Click on the date value in a query to find out more.
All strings must be either single-word or enclosed in "
or '
. This extends to date values like 2024-03-11
.
Operators
The available operators for filtering include:
!=
: Not equal to=
: Equal to>
: Greater than>=
: Greater than or equal to<
: Less than<=
: Less than or equal tolike
: Matches a pattern (using wildcard%
)in
: Matches any value in a comma-seperated list of values
To combine multiple conditions, you can use the following logical operators:
&&
: AND operator, matches if all conditions are true||
: OR operator, matches if any of the conditions are true(
and)
: Parentheses for grouping conditions
Examples
Here are some examples of filter queries:
priority = 4
: Matches tasks with priority level 4dueDate < now
: Matches tasks with a due date in the pastdone = false && priority >= 3
: Matches undone tasks with priority level 3 or higherassignees in [user1, user2]
: Matches tasks assigned to either "user1" or "user2(priority = 1 || priority = 2) && dueDate <= now
: Matches tasks with priority level 1 or 2 and a due date in the past