Time in status - JQL (field)

Data Center This page documents Time in status, Timer, Stopwatch and Calendar fields for Jira Data Center and Server. On Jira Cloud? See Time in Status (Forge) for Jira Cloud.

The search uses two mechanisms for working with counter values.

  1. The first works with indexes. It is fast on any amount of data. But this data is current at the time the indexes were created. In the case of running time counters, a difference appears between the value stored in the index and the real one.
  2. The second mechanism works with real data. It is noticeably slower than working with indexes. It is artificially limited in the amount of processed data (limits are set in the JQL settings). But it works with real, relevant data now. Where possible, but works with indexes.
This is why a search can return a different number from the one on the issue view - the issue view computes the value live, an indexed function reads it as of that issue's last indexing. Live value vs. indexed value shows which screen reads which, when the index is refreshed, and why SLA thresholds belong in a realTime* function.

Functions take the following parameters.

  • jql - a string with a valid search query. For example: “Project = TEST and created < startOfWeek()”
  • statuses - the name or id of the statuses, separated by commas. For example: “Open” or “Open, 10000, 10001”.
  • condition - one of the characters <, <=, => =,>. For example: “>”.
  • calendar - the name or id of the calendar. For example: “Support” or “1”. How to view calendars?
  • time - time string corresponding to one of the patterns.
"5h35m12s" - 5 hours 35 minutes 12 seconds
"5h12s" - 5 hours 12 seconds
3000m - 3000 minutes
"0", "0s" ... - time is zero.

Search functions in the “Time in status” field.

Work when search engine is connected Search Templates

time-in-status-field-searcher screenshot

“Time in status” in active ()

  • Returns tasks that have a counter running. those. They are in the statuses specified in the field settings.
  • It looks like status was in (open) where open is the status from the field settings.
  • The function works with indexes.

“Time in status” in inactive ()

  • Returns tasks for which the counter is not running. those. They are not in the statuses specified in the field settings.
  • It looks like status not in (open) where open is the status from the field settings.
  • The function works with indexes.

“Time in status” in time (“condition”, “time”)

  • Returns tasks whose value fields correspond to the condition.
  • The function works with indexes.

“Time in status” in realTime (“condition”, “time”)

  • The task returns the real value of the field which corresponds to the condition.
  • The function works in real time.
  • Since 6.3/6.4 it runs as a single indexed search instead of a nested one, and is no longer restricted by the JQL count limit.
  • The function is suitable for sampling active counters. Real-time reporting, work queues of tasks with reference to reaction time, execution …

“Time in status” in realTimeBetween (“time”, “time”)

  • The task returns the real value of the field which is in the specified range.
  • The function works in real time.
  • Since 6.3/6.4 it runs as a single indexed search instead of a nested one, and is no longer restricted by the JQL count limit.
  • The function is suitable for sampling active counters. Real-time reporting, work queues of tasks with reference to reaction time, execution …
  • It works in some cases faster than “in realTime” because limits the range requiring calculation on both sides.

realTime() and realTimeBetween() in the “Time between statuses” field

As of the release after 6.6.0 (Jira 10 and Jira 11.3) realTime ("condition", "time") and realTimeBetween ("time", "time") also work with the Time between statuses field: cf[N] in realTime(">", "2h") finds the issues whose working time by the calendar of the field from the first entry into a start status is more than 2 hours - by the final value for the issues that have reached an end status, and up to the moment of the search for the issues still on their way.

The field needs the search template Time between statuses searcher (realtime) (Custom fields → the field → Edit details → Search template) and a re-index after the update. Without it realTime() gives a JQL error with the name of the search template; the plain number search, is EMPTY and sorting keep working. See Live search: realTime() and realTimeBetween().

Sorting

By the field “Time in status” it is possible to sort. Sorting orders issues by the value held in the index, so a running counter is ordered by its value as of that issue’s last indexing rather than by what the issue view shows right now - see Sorting and gadgets order by the indexed value. If the ordering has to be exact, filter with realTime* first so that everything in the result is already past the threshold. If sorting does not occur, you may not have the appropriate rights.

  • JQL config
  • Access to value and sort by “Time in status” field

Examples

  • “Time in status” in time (“>”, “1h”)
  • “Time in status” in realTime (“<”, “1h”)
  • “Time in status” in realTimeBetween (“1h”, “2h”)

For SLA thresholds and breach boards use the real-time variants, and scope the query by project first so the live calculation runs over a board’s worth of issues: Use realTime* for SLA thresholds and breach boards.

Name conflicts with other apps

A JQL function may be unavailable if another installed app provides a function with the same name. Go to Manage apps, expand the modules of one of the two apps and disable the module that provides the conflicting JQL function.


JiBrok time in status Time in status | SLA | Timer | Stopwatch
Migration
Release notes
Tutorials
Settings
Troubleshooting
Work calendars
Time in status
Timers and Stopwatches
Stopwatch
Timer
Additional functions
Issue panels
Reports
Field Helpers
Other fields
API
Reference information