threadTimeSeriesMetric returns a metric as one value per time bucket, such as threads created per day or median first response time per week. Use it for line and bar charts.
For TypeScript, the GraphQL SDK gives you a fully typed client for these operations.
metrics:read permission, or metricsAgent:read for agent_ metrics. See Permissions.
Get a time series
input takes these fields:
metricName: any time series metric from the metrics referencefromandto: the date range, in UTC. See Dates and time zonesinterval: the bucket size, withunitset toHOUR,DAY,WEEK,MONTH,QUARTER, orYEARmode:METRICfor values, orTHREAD_IDSfor the threads behind thempercentile: for duration metrics, an integer from 1 to 99. Defaults to 50filtersandgroupBy: see Filter and group reporting queries
__OTHER__:
Query
Variables
Read the response
timestamps lists the start of every bucket in the range, in order. Each entry in series has a values list that lines up with timestamps index by index, and a group that says which group the series belongs to. Without groupBy, series has one entry and its group is null.
A null in values means there was no data in that bucket. Buckets are never dropped, so the list always covers the whole range. Threads in Todo, Snoozed, and Done (threads_status_count__*) carry the last known count forward instead.
Get the threads behind a bucket
Setmode to THREAD_IDS to get the distinct IDs of the threads behind the value. The IDs cover the whole range, so narrow from and to to one bucket to get its threads. To get one group’s threads, add the group as a filter instead of using groupBy, which isn’t allowed in this mode.
This query returns the Enterprise tier threads that moved to Done on September 14:
Query
Variables
timestamps and series are null in this mode.
