Time tracking
The time tracking column represents the total time spent on a task. Our API partially supports the time tracking column, so you can filter and read it, but can't update or clear it via the API.
Filtering the 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 |
---|---|
any_of | 1 (time tracker paused or empty)2 (time tracker running) |
not_any_of | 1 (time tracker paused or empty)2 (time tracker running) |
Pro tip
items_page
is only available in API version2023-10
for now.
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
}
}
}
}
Reading the time tracking column
You can query the time tracking column using the column_values
object. The object has different fields based on which API version you are using. Column values v2 fields will be available in API versions 2023-10
and later, while column values v1 fields are only supported in versions 2023-07
and 2023-04
.
Column values v2
The column_values
object 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.
Pro tip
column_values
v2 fields are only available in API version2023-10
.
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. |
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. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
Column values v1
You can return the data in a time tracking column in two different formats when you query by column values. The text
field will return the total time in (HH:MM:SS format) as a simple string. The value
field will return metadata about the column as a JSON string.
Removing column values v1 support
column_values
v1 fields will no longer be supported in API versions2023-10
and later.
{
"text": "01:00:00",
"value": "{\"running\":false,\"duration\":3600,\"startDate\":1659715755,\"additional_value\":[{\"id\":262839901,\"account_id\":12695383,\"project_id\":2973227079,\"column_id\":\"time_tracking\",\"started_user_id\":31855020,\"ended_user_id\":31855020,\"started_at\":\"2022-08-05T15:09:00Z\",\"ended_at\":\"2022-08-05T16:09:00Z\",\"manually_entered_start_time\":true,\"manually_entered_end_time\":true,\"manually_entered_start_date\":true,\"manually_entered_end_date\":true,\"created_at\":\"2022-08-05T16:09:15Z\",\"updated_at\":\"2022-08-05T16:09:15Z\",\"status\":\"active\"}]}"
}
Check out the full list of keys in the value
field below!
{
account_id: 12345,
column_id: "time_tracking",
created_at: "2020-10-29 16:29:27 UTC", // when the session was added to the cell
started_at: "2020-10-29 16:29:26 UTC", // only applicable if the session was added by pressing the play button or via automation
ended_at: "2020-10-29 16:29:28 UTC", // only applicable if the session
started_user_id: 4012689,
ended_user_id: 4012689,
id: 40949481, // unique session ID
manually_entered_start_date: false, // true if the session was manually entered
manually_entered_start_time: false, // true if manually entered
manually_entered_end_date: false,
manually_entered_end_time: false,
project_id: 162169281, // item ID,
status: "active",
updated_at: "2020-10-29 16:29:28 UTC"
}
Join our developer community!
We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎
Updated 3 months ago