Live value vs. indexed value

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.

A support ticket that comes back regularly reads like this: the issue view shows 20h in a Time in status field, and a filter, a sorted queue or a dashboard gadget shows 28h for the same issue on the same day.

Neither number is wrong, and nothing needs repairing. They come from two different mechanisms, and the difference between them is a design property of the app worth knowing before you build an SLA process on top of it.


Two mechanisms, one field

A Time in status, Timer or Stopwatch value is computed, never stored - see Field value format and export for BI. Computing it means walking the issue’s history under the field’s configuration and working calendar, which is too expensive to do for every issue in a search over a large instance.

So the app keeps a copy of the value in Jira’s search index and answers from whichever source fits the job:

  • Live - the value is computed at the moment you look at it. Always current, to the second.
  • Indexed - the value is read from the search index. Fast at any volume, but it is the value as of the last time that issue was indexed.

For a counter that has stopped, the two are identical forever. For a running counter, the indexed value falls behind by however long the counter has been running since that issue was last indexed. That gap is the whole of the 20h vs 28h story.


Which screen reads which

Screen or consumer Value Fresh as of
Issue view - field and issue panels Live Now
The app’s REST API Live Now
Reports and their exports Live, computed when the report runs The report’s last run
JQL time(), timeSpent(), pauseTime() Indexed Last indexing
JQL active(), inactive(), isRunning(), isPaused(), isFailed(), isCompleted() Indexed Last indexing
JQL realTime(), realTimeBetween(), realTimeSpent(), realPauseTime(), isFailedRealTime(), timeLeft() Live Now
Sorting by the field in the issue navigator Indexed Last indexing
Dashboard gadgets and statistics built on the field Indexed Last indexing
Periodic calculation of the function by JQL field Aggregate over a JQL selection Its own schedule

“Last indexing” in that table means the last time that one issue was reindexed - it is per issue, not a global clock, so two issues in the same filter can be stale by very different amounts.

The common functions issue in timeInStatus(...), timeInStatusByJql(...) and timeInStatusByJqlAndWorkCalendar(...) are not field searches at all - they have no field and therefore no index entry, and are computed from issue history under the limits on the JQL performance settings page.

Read the table as a rule of thumb with one exception you already know: a function whose name starts with realTime is live, everything else on the field is indexed. timeLeft() and isFailedRealTime() are live too, because a deadline that has passed while the timer is still running cannot be answered from a stale value.

What the index holds, and when it changes

For each issue and each of the app’s fields, the index carries two entries:

Entry What it is
<field>.time The value of the counter at the moment the issue was indexed, in seconds.
<field>.lastIndex When that value was written.

.lastIndex is what makes the drift measurable rather than mysterious: for a running counter, the live value is .time plus the time the counter has been running since .lastIndex.

The index entry is rewritten only when the issue is reindexed. That happens when:

  • the issue changes - a transition, an edit, a comment, an automation touching a field, anything Jira reindexes the issue for;
  • an administrator runs a full re-index, a project re-index or a background re-index (Administration → System → Indexing);
  • Restore timer and stopwatch by issue history writes new values, which reindexes the issues it touched.

Nothing else refreshes it. There is no timer inside the app that walks the instance and rewrites index entries as counters tick - that would mean reindexing every issue with a running counter, continuously.

The practical consequence: an issue nobody has touched for a week carries a week-old index entry. A queue that has been sitting untouched is exactly the queue whose indexed times are furthest behind - and exactly the queue an SLA report is about. The busiest issues have the freshest index; the stuck ones have the stalest.

Changing a field’s configuration does not retroactively fix index entries either. Settings listed under Reindex on the field configuration page need a re-index before searches agree with the issue view; after an upgrade, gadget statistics need a full re-index.


Use realTime* for SLA thresholds and breach boards

If a query decides whether something has breached, it has to be live. time() on a running counter answers “had this issue passed the threshold as of its last indexing”, which is not the question anyone is asking.

The realTime* functions answer it. They start from the indexed value and add the time the counter has been running since .lastIndex, so their result matches what the issue view shows.

Breach boards and threshold queues:

project = SUP AND resolution = EMPTY AND "Time in New" in realTime(">", "4h")
project = SUP AND "First response" in isFailedRealTime()
project = SUP AND "First response" in realTimeSpent(">", "2h")

About to breach - a warning board rather than a post-mortem:

project = SUP AND "Resolution timer" in timeLeft("<", "30m")

A band rather than a threshold - realTimeBetween bounds the calculation on both sides, so it is often the cheaper of the two:

project = SUP AND "Time in New" in realTimeBetween("1h", "2h")

Use time() where it is genuinely the right tool: historical analysis, closed issues, anything where the counter has already stopped and the indexed value is exact.

On large instances, scope the query before the live function runs. Put the cheap, indexed conditions first - project, status, resolution = EMPTY - so the live calculation runs over a board's worth of issues rather than the whole instance. Real-time functions are capped by Count limit on the JQL performance settings page; a query that exceeds the cap is truncated rather than slowed down forever, so an unscoped breach board can quietly show you part of the answer.

Two settings on that page are worth knowing about when you roll realTime* out to a whole support team:

  • Cache - speeds up repeated queries within a minute, at the cost of displaying time accurate to the minute.
  • Ignore count limit - raises the cap for named users, which is what scripts, dashboards and reporting service accounts usually need.

Sorting and gadgets order by the indexed value

Sorting a queue by a Time in status, Timer or Stopwatch column orders issues by <field>.time, not by the live value. Two issues whose counters are both running can therefore appear in an order that does not match the numbers you get by opening them - the one indexed longer ago sorts lower than it should.

The same applies to dashboard gadgets and Statistic Type groupings: they bucket issues by the indexed value. See Statistics and averages in reports for how a statistics gadget differs from a report aggregate in the first place.

If the ordering has to be exact, filter with a realTime* function so that everything in the result is already known to be past the threshold, and treat the column order as approximate.


The JQL function field is a third thing

The Periodic calculation of the function by JQL field is neither live nor indexed-per-issue. It runs a JQL query on its Schedule Expression, aggregates the main field’s values over the issues it finds, and stores the single result until the next run.

  • The value is the same for every issue in that field context - it is a property of the selection, not of the issue.
  • It is as fresh as the last scheduled run, which is neither “now” nor “when this issue was last indexed”.

Comparing it against a per-issue value and expecting them to line up is a category error - see Statistics and averages in reports, which covers the same trap for report aggregates.


When two numbers disagree

  1. Note which screens disagree. Issue view vs. JQL search, or issue view vs. sorted column, is the expected behaviour described on this page - not a bug.
  2. Check whether the counter is running. A stopped counter that still disagrees is a different problem: start from The field does not appear or is empty.
  3. Touch the issue, or run a re-index, and look again. If the indexed number jumps to the live one, you were looking at index lag.
  4. If the query drives an SLA decision, rewrite it with realTime(), realTimeSpent() or isFailedRealTime() and scope it by project.
  5. If the number came from a report, compare generation times rather than the values - a report holds the data of its last run.

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