Skip to main content
threadSingleValueMetric returns one value for the whole date range, such as median resolution time this month or SLA compliance this quarter. With groupBy, it returns one value per group, which suits tables and leaderboards.
For TypeScript, the GraphQL SDK gives you a fully typed client for these operations.
This query requires the metrics:read permission, or metricsAgent:read for agent_ metrics. See Permissions.

Get a single value

input takes these fields:
  • metricName: any single value metric from the metrics reference
  • from and to: the date range, in UTC. Required for every metric except threads_all_time_count_done, which rejects them. Both are widened to whole hours
  • mode: METRIC for values, or THREAD_IDS for the threads behind them
  • percentile: for duration metrics, an integer from 1 to 99. Defaults to 50
  • filters and groupBy: see Filter and group reporting queries
This query returns each user’s median resolution time for September:
Query
Variables

Read the response

values has one entry per group, or a single entry when there’s no groupBy. Each entry has a value and a group. value is null when the group had no data in the range. Entries aren’t sorted, so sort them yourself.

Get the threads behind a value

Set mode to THREAD_IDS to get the distinct IDs of the threads behind the value in threadIds. values is null in this mode, and groupBy isn’t allowed, so add a group as a filter to get its threads.