Learn how to filter by and read the time tracking column on monday boards using the platform API
The time tracking column represents the total time spent on a task. The API allows you to read and filter the time tracking column.
Read a time tracking column
You can query the time tracking column using the column_values object that enables you to return column-specific subfields by sending a fragment in your query. Values for the time tracking column are of the TimeTrackingValue type.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on TimeTrackingValue {
running
started_at
}
}
}
}Fields
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
duration Int | The total duration of the time tracker in seconds. |
history [TimeTrackingHistoryItem!]! | The column's history. |
id ID! | The column's unique identifier. |
running Boolean | Returns true if the time tracker is currently running. |
started_at Date | The date the time tracker started. |
text String | The column's value as text. This field will return "" if the column has an empty value. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
Filter a time tracking column
Using the items_page object, you can easily filter a board's items by specific columns or column values. The table below contains the time tracking column's supported operators and compare values.
Operators | Compare Values |
|---|---|
|
|
|
|
Examples
The following example returns all items on the specified board with a running time tracker.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "time_tracking"
compare_value: [2]
operator:any_of
}
]
}
) {
items {
id
name
}
}
}
}