Filter tasks using Custom Fields
Use Custom Fields to filter tasks with the Get Tasks and Get Filtered Team Tasks endpoints.
Filter tasks using Custom Fields
Use Custom Fields to filter tasks via the following endpoints:
- Get Tasks: For tasks within a specific List.
- Get Filtered Team Tasks: For tasks across your entire Workspace.
Tip
Use Get Tasks when you know the List where the tasks are located. Use Get Filtered Team Tasks to find tasks anywhere in your Workspace.
Using Custom Field Filters
When filtering by a Custom Field, provide a stringified JSON array of objects that must include the following properties:
field_id
value
operator
field_id
field_id
The field_id
refers to the ID of the Custom Field you want to filter by. Retrieve it using the Get Accessible Custom Fields endpoint.
Operators
The supported operators for filtering are:
=
- equals<
- less than<=
- less than or equal to>
- greater than>=
- greater than or equal to!=
- not equal toIS NULL
- field is not setIS NOT NULL
- field is setRANGE
- is betweenANY
- matches any criteriaALL
- matches all criteriaNOT ANY
- does not match any criteriaNOT ALL
- does not match all criteria
Value
The value
corresponds to the data in the Custom Field. This depends on the Custom Field type.
Tip
Create a task and add a value to the Custom Field you want to filter. Then, use the Get Tasks endpoint to identify the
field_id
and its acceptablevalue
.
Example Query
Here's an example of a Custom Field query parameter:
?custom_fields=[{"field_id":"de761538-8ae0-42e8-91d9-f1a0cdfbd8b5","operator":">","value":2},{...}]
Breakdown
field_id
: Identifies the Custom Field. In this case, it's a Number Custom Field named Number of Reports.operator
: Specifies the comparison operator. Here,>
means "greater than."value
: Specifies the threshold value. In this example, it's2
.
This query returns tasks where the Number of Reports is 3 or more.
{...}
: Represents additional Custom Fields to include in the filter, if needed.
Updated 6 days ago