Say your lead asks a simple question in retro: which tickets sat in code review the longest last sprint? Jira has the answer — every status change is in the issue history. It just doesn't give you a field for it. You can't sort by it, filter on it, or put it on a board card.
I went through the top Google results for this, and nearly all of them end the same way: install an app. I work at a company that makes one, so I won't pretend apps are useless. But they aren't the only option, and depending on what you need, they may not be the best one.
So here are three ways to build a time in status field — Jira Automation, a small Python script against the REST API, and Time in Status app by SaaSJet. They don't always give the same number, and I'll show you where and why.
What is a Jira time in status field?
A time in status field is a custom field that shows how long a work item has spent in a status or a status group, calculated from its status history. You can track a custom field with Jira Automation, calculate and write it through the REST API, or use a Marketplace app that provides the calculation.
The field becomes useful when everyone understands its definition. For example, “Review time” could mean the latest visit to Review, all visits added together, or only the portions of those visits that overlap working hours. Choose one before you build.
It isn't time tracking either. A ticket can have two hours of logged work and three days in review — nobody logs waiting.
Does Jira have a native time in status field?
No. Jira has no built-in time in status custom field. It has two partial ways to see status duration, and it's worth knowing exactly where each stops before you build anything.
Days in column
Company-managed boards can show Days in column: a row of dots on each card, one per day. It's useful as a glance, but check three things before you treat it as your metric:
• It measures a board column, not a status. If your Review column maps both In Review and Waiting for Approval, the dots count both.
• It accumulates. When a work item returns to a column it was in before, Atlassian's docs say the indicator shows the cumulative days for that column — not the time since the latest entry.
• It isn't a field. You can't query it in JQL, sort by it, or export it. Atlassian also recommends leaving it off on very large instances for performance reasons.
Native JQL
JQL can tell you whether a work item was in a status, never for how long. The closest you get is "currently in this status for longer than X":
project = DEMO
AND status = "In Review"
AND created <= "-2d"
AND NOT (status CHANGED AFTER "-2d")
This reads: the work item is in review now, it hasn't entered review in the last two days, and it's old enough that "created directly in review" doesn't sneak through.
The query you'll find more often — status CHANGED TO "In Review" BEFORE -2d — is subtly wrong. It matches any work item that entered review more than two days ago at any point, including one that bounced back into review an hour ago.
What native JQL can't do at all: sum repeat visits, compare durations between work items, exclude weekends, or sort by time in status. If you need any of those, you need a field.
Define your metric and choose an approach
Most "wrong" time in status values aren't bugs — they're two people using different definitions. Answer five questions before you build:
Which statuses? One status, or a group such as In Review + Waiting for Approval counted as "review time".
Repeat visits: sum every visit, or count only the latest one?
The open stay: include the visit that hasn't ended yet? If yes, the value is only as fresh as its last recalculation.
Calendar: 24/7, or working hours only?
Unit and precision: hours with two decimals, or whole days?
How the three approaches compare
| Jira Automation (basic rules) | REST API script | Time in Status by SaaSJet | |
|---|---|---|---|
| Historical backfill | No — counts only transitions after the rules are on | Yes — reads the full changelog | Recalculates every item in scope on each run |
| Current open stay | No, without an extra scheduled rule | Yes, as of the last run | Yes, as of the last run (Current status mode) |
| Repeat visits | Yes, if the rule adds to a running total | Yes | Check with the test below |
| Status groups | One rule pair per status | Yes — a set of status IDs | Yes — Selected statuses |
| Working hours | Whole business days only, no hours or holidays | You write it | Yes — linked work schedule |
| Queryable in JQL | Yes — Number field | Yes — Number field | Yes — durations like 2h, 1d
|
| When the value updates | When the issue leaves the status | On each scheduled run | Hourly, daily, or weekly, or Update now |
| Side effects of updates | Each edit adds to issue history | Each write adds to issue history | Not documented — check the issue history |
| Maintenance | Rules per status | Script, scheduler, API token | Admin setup; the vendor maintains the calculation |
Which one to pick
• Jira Automation if you track one or two statuses, only care about work items from now on, and nobody wants to own code.
• REST API script if you need history from day one, status groups, or full control over the definition — and someone will own the script.
• A Marketplace app if you need many fields, working calendars, or admins who shouldn't maintain scripts. It's also the honest answer once your script starts growing features.
Create a time in status field with Jira Automation
The Automation version is two rules: stamp the time when an issue enters the status, and add the elapsed time to a running total when it leaves.
It's the approach in Atlassian's own recipe, with two fixes for precision and repeat visits.
1. Create two custom fields
• Review entered at — Date Time Picker.
• Time in Review (h) — Number.
Add both to the contexts for your project and work types. Note their IDs; below they're customfield_10050 and customfield_10051.
2. Rule A: stamp the entry
• Trigger: Work item transitioned → To status: In Review
• Action: Edit work item fields → Review entered at = {{now}}
3. Rule B: add the stay on exit
• Trigger: Work item transitioned → From status: In Review
• Condition: Review entered at is not empty
• Action: Edit work item fields → Time in Review (h) =
{{#=}}{{issue.customfield_10051|0}} + {{issue.customfield_10050.diff(now).minutes}} / 60{{/}}
• Action: Edit work item fields → clear Review entered at
Two details in that expression matter:
• |0 makes the first visit work: the total is empty until then, and empty plus a number isn't a number.
• .minutes / 60 instead of .hours: a date diff returns whole units, so .hours would turn 1 h 59 min into 1. With minutes, each visit loses less than a minute.
Where the Automation field breaks
• No history. Work items that left review before you enabled Rule A stay empty. Work items sitting in review at that moment have no entry stamp, so Rule B skips them and their current visit is lost. Use the REST API script once for backfill if you need it.
• No open stay. The total only grows when a work item leaves review. A work item stuck there for five days shows the total of its earlier visits — possibly zero. For "stuck" alerts, use the JQL from the previous section, or add a scheduled rule that writes a separate "including current visit" field. That rule runs against your automation usage limits.
• Created straight into the status. No transition means no stamp. Add a third rule on Work item created with the condition Status = In Review.
• Working hours. .businessDays exists, but it counts whole weekdays. No hour schedules, no holidays.
• Every update is an issue change. Each edit adds to the issue history and moves Updated. Turn off notifications in the Edit action's options. Other rules won't fire on these edits unless they have Allow rule trigger enabled.
Calculate and write the field with the REST API
The script reads each issue's full status history, sums every visit to the target statuses, adds the open visit up to the moment of calculation, and writes the result into a Number field. Unlike the Automation rules, it works on history from day one.
Before you run it
• A Number field associated with the project and work types you'll update. On Jira Cloud the field no longer needs to be on the edit screen: since October 2025 the issue edit API doesn't require it, but the field must still be associated with that project and work type. On Data Center, check your version's rules.
• An API token for an account with Edit work items permission. Suppressing notifications (notifyUsers=false) also needs project or Jira admin permission.
• Status IDs, not names. Get them from GET /rest/api/3/status. IDs survive renames and translated status names; the names stored in the changelog don't.
The script
import os
import time
from datetime import datetime, timezone
import requests
BASE_URL = os.environ["JIRA_BASE_URL"] # https://your-site.atlassian.net
FIELD_ID = "customfield_10051" # Number field: Time in Review (h)
TARGET_STATUS_IDS = {"10003"} # one status, or a group of IDs
JQL = os.environ.get("JQL", 'project = ABC AND status WAS "In Review"')
session = requests.Session()
session.auth = (os.environ["JIRA_EMAIL"], os.environ["JIRA_API_TOKEN"])
session.headers["Accept"] = "application/json"
def call(method, path, **kwargs):
"""One Jira call, retried when rate-limited."""
while True:
r = session.request(method, BASE_URL + path, **kwargs)
if r.status_code == 429:
time.sleep(int(r.headers.get("Retry-After", "10")))
continue
r.raise_for_status()
return r.json() if r.content else None
def parse(ts):
# Jira timestamps look like 2026-11-03T10:15:22.123+0200
return datetime.strptime(ts, "%Y-%m-%dT%H:%M:%S.%f%z")
def search(jql):
"""Yield every issue matching the JQL (enhanced search, token paging)."""
body = {"jql": jql, "fields": ["created", "status", FIELD_ID], "maxResults": 100}
while True:
page = call("POST", "/rest/api/3/search/jql", json=body)
yield from page["issues"]
if not page.get("nextPageToken"):
return
body["nextPageToken"] = page["nextPageToken"]
def status_changes(key):
"""All status transitions as (time, from_id, to_id), oldest first."""
changes, start = [], 0
while True:
page = call("GET", f"/rest/api/3/issue/{key}/changelog",
params={"startAt": start, "maxResults": 100})
for history in page["values"]:
for item in history["items"]:
if item.get("fieldId") == "status":
changes.append((parse(history["created"]), item["from"], item["to"]))
start += len(page["values"])
if page.get("isLast", True) or not page["values"]:
return sorted(changes)
def hours_in_status(issue, now):
changes = status_changes(issue["key"])
entered = parse(issue["fields"]["created"])
# The status an issue was created in is the "from" of its first transition.
current = changes[0][1] if changes else issue["fields"]["status"]["id"]
seconds = 0.0
for when, _from, to in changes:
if current in TARGET_STATUS_IDS:
seconds += (when - entered).total_seconds()
current, entered = to, when
if current in TARGET_STATUS_IDS: # still there: count the open stay
seconds += (now - entered).total_seconds()
return round(seconds / 3600, 2)
def main():
now = datetime.now(timezone.utc)
for issue in search(JQL):
value = hours_in_status(issue, now)
if issue["fields"].get(FIELD_ID) == value:
continue # unchanged: no history noise
call("PUT", f"/rest/api/3/issue/{issue['key']}",
params={"notifyUsers": "false"},
json={"fields": {FIELD_ID: value}})
print(f"{issue['key']}: {value} h")
if __name__ == "__main__":
main()
Run it twice: backfill, then incremental
Run it once with the default JQL to backfill every issue that was ever in review. Then schedule it — hourly cron or a GitHub Actions schedule — with a narrower query so each run touches only issues whose value can change:
project = ABC AND (status = "In Review" OR status CHANGED FROM "In Review" AFTER -2h)
The two-hour window overlaps an hourly schedule, so a late run doesn't miss an exit.
Where the script breaks
• The value is as fresh as the last run. For an issue still in review, the field shows the time up to that run, not up to now.
• Every write is an issue change. A write through PUT /rest/api/3/issue/{key} moves Updated, adds a history entry, and can trigger Automation rules listening for updates. That's why the script skips unchanged values. Run it as a dedicated integration account and exclude that account in rules that should react only to people. Filters such as updated >= -1d will now also return machine updates.
• One changelog call per issue. Fine for hundreds of issues, slow for a full backfill of a large instance. The incremental JQL keeps scheduled runs small.
• 24/7 only. Working hours mean intersecting each interval with a calendar of hours, time zones, and holidays — doable, but it's the point where a script starts turning into a product.
Add a time in status field with a Marketplace app
An app gives you the field with the calculation, refresh, and usually working calendars already built. Time in Status by SaaSJet is one of the apps that does this.
Here's what the setup looks like in Time in Status by SaaSJet. A Jira admin creates the field under Jira settings → Apps → Manage apps → Time in Status → Custom fields → Create new field. The wizard has three steps, and the second one is where the metric decisions from earlier get made.
Step 1: Name the field
For the test in this article: TIS [Review]. The name must be unique among your custom fields, because it's how you reference the field in JQL.
Step 2: Decide what it measures
• Where it applies: a field scheme plus the work types it covers. That's the native Jira mechanism, so the field works across every project the scheme covers, not just one board.
• Statuses: Current status measures how long an item has been wherever it is right now — useful for spotting stuck work. Selected statuses sums the statuses you pick into one metric. For the test: In Review. Add Waiting for Approval and it becomes a review-time group; the same option builds Cycle Time or Lead Time.
• Work schedule: 24/7 for raw elapsed time, or a business calendar that skips nights, weekends, and holidays. This is the part that's painful to build in the other two approaches.
• Update frequency: hourly, daily, or weekly, plus an Update now button.
Step 3: Choose screens
Pick the screens where the field should appear. Team-managed projects add it from their own project settings. To show it on cards: Board settings → Card layout → add the field.
Creating the field doesn't calculate anything yet. Values appear after the first scheduled run or after Update now.
What you see
On board cards and in the issue view, the value is shown as days and hours.
Under the hood it's stored in seconds. JQL compares the exact value, not the rounded label, so an item showing 1d can still match > 1d. Through the REST API, fields returns the raw seconds and renderedFields returns the formatted value.
In JQL, durations are written in days and hours:
"TIS [Review]" > 2h
status = "In Progress" AND "TIS [Review]" >= 1d
ORDER BY "TIS [Review]" DESC
Where the app field breaks
• Workflow changes need attention. If a grouped status is removed from the workflow, its time stops counting and the app flags the field.
• Setup is admin-only. Creating and managing fields requires Administer Jira.
Don't want to maintain rules or a script? Try Time in Status by SaaSJet with a free trial from the Atlassian Marketplace. Create a field for your statuses, link a work schedule, and run the same test from this article on your own work items.


Top comments (2)
Wow, that’s really interesting to read. Thanks for sharing
thanks:)