Filter tasks using Custom Fields

You can filter tasks using Custom Fields with the following endpoints:

Tip

Use Get Tasks when you know the List where your tasks live. Use Get Filtered team tasks to find tasks anywhere in your Workspace.

Use Custom Field filters

When using a Custom Field as a filter, you must provide a stringified JSON array of objects that must include these fields:

  • field_id
  • value
  • operator

Field_id

The field_id can be found using Get Accessible Custom Fields endpoint.

Operators

The following operators are supported:

  • = (equals)
  • < (less than)
  • <= (less than or equal to)
  • > (greater than)
  • > = (greater than or equal to)
  • != (not equal to)
  • IS NULL (is not set)
  • IS NOT NULL (is set)
  • RANGE (is between)
  • ANY (contains any matching criteria)
  • ALL (contains all matching criteria)
  • NOT ANY (does not contain any mathching criteria)
  • NOT ALL (does not contain all of the matching criteria)

Value

The value you provide is the data found in the Custom Field. This varies based on the type of Custom Field.

Tip

Create a task and add a value to the Custom Field you want to filter. Then use the Get Task endpoint to find the field_id and acceptable value!

Example

Here's an example of a Custom Field query parameter: ?custom_fields=[{"field_id":"de761538-8ae0-42e8-91d9-f1a0cdfbd8b5","operator":">","value":2},{...}]

Let's break that down: The first part is the query parameter: ?custom_fields=

Then field_id contains the id of the Custom Field itself. This one is a number Custom Field called Number of Reports.

The operator is > meaning greater than.

The value is 2.

Using this query parameter this will return tasks where the Number of Reports is 3 or more.

Lastly the {...} at the end represents any additional Custom Fields we want to filter by.