TDQ Query Language
TDQ (td Query) is a powerful expression language for filtering issues. It is used by the td query command and in board definitions to select issues matching specific criteria.
Basic Queries
td query "status = in_progress"
td query "priority <= P1"
td query "type = bug"
td query "labels ~ auth"
Operators
| Operator | Meaning | Example |
|---|---|---|
= | Equals | status = open |
!= | Not equals | status != closed |
~ | Contains | labels ~ frontend |
!~ | Not contains | title !~ WIP |
< | Less than | priority < P2 |
> | Greater than | priority > P3 |
<= | Less than or equal | priority <= P1 |
>= | Greater than or equal | priority >= P2 |
Boolean Operators
Combine expressions with AND, OR, and NOT. Use parentheses to control precedence. Spaces between expressions are treated as implicit AND.
td query "status = in_progress AND priority <= P1"
td query "type = bug OR type = feature"
td query "priority <= P1 AND NOT labels ~ frontend"
td query "(type = bug OR type = feature) AND status != closed"
# Implicit AND — these are equivalent:
td query "type = bug priority = P0"
td query "type = bug AND priority = P0"
Available Fields
| Field | Description |
|---|---|
status | Issue status: open, in_progress, in_review, closed, blocked |
type | Issue type: bug, feature, task, etc. |
priority | Priority level: P0, P1, P2, P3, P4 |
points | Story points (numeric) |
labels | Comma-separated label list |
title | Issue title text |
description | Issue description text |
created | Creation timestamp |
updated | Last updated timestamp |
closed | Closed timestamp |
implementer | Assigned implementer |
reviewer | Assigned reviewer |
parent | Parent issue ID |
epic | Epic issue ID |
Date Queries
Use relative date expressions with duration suffixes:
td query "created >= -7d" # Created in last 7 days
td query "updated >= -24h" # Updated in last 24 hours
Query Functions
Built-in functions provide common filter patterns:
td query "rework()" # Issues rejected and needing fixes
td query "stale(14)" # Issues not updated in 14 days
Case-Insensitive Values
Enum fields (status, type, priority) accept values in any case. All of these are equivalent:
td query "priority = P0"
td query "priority = p0"
td query "status = OPEN"
td query "type = Bug"
The is() function is also case-insensitive: is(Open) works the same as is(open).
Inline Sort
Add sort:field clauses directly in the query string. Prefix with - for descending order.
td query "type = bug sort:priority" # Sort by priority ascending
td query "type = bug sort:-priority" # Sort by priority descending
td query "status = open sort:-priority sort:created" # Multiple sort fields
Using with Boards
Define boards with persistent query filters:
td board create "Urgent Bugs" --query "type = bug AND priority <= P1"
Issues matching the query will appear on the board automatically. See Boards for more on board configuration.