Skip to main content

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​

OperatorMeaningExample
=Equalsstatus = open
!=Not equalsstatus != closed
~Containslabels ~ frontend
!~Not containstitle !~ WIP
<Less thanpriority < P2
>Greater thanpriority > P3
<=Less than or equalpriority <= P1
>=Greater than or equalpriority >= 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​

FieldDescription
statusIssue status: open, in_progress, in_review, closed, blocked
typeIssue type: bug, feature, task, etc.
priorityPriority level: P0, P1, P2, P3, P4
pointsStory points (numeric)
labelsComma-separated label list
titleIssue title text
descriptionIssue description text
createdCreation timestamp
updatedLast updated timestamp
closedClosed timestamp
implementerAssigned implementer
reviewerAssigned reviewer
parentParent issue ID
epicEpic 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.