Skip to main content

timeInStatus

Overview

The timeInStatus function allows you to find issues that have spent a specific amount of time in a given status. This is useful for tracking how long issues remain in particular workflow states.

For comprehensive documentation including the Time in Status custom field and timeExpression function, see Time in Status Field and timeExpression.

Syntax

issue operator timeInStatus("subquery", "status", "time_expression")

Parameters

  • subquery (required): A valid JQL query that defines the set of issues to evaluate
  • status (required): The name of the status to track (validated against your Jira instance)
  • time_expression (required): A time expression in format "2w 3d 5h 4m" where:
    • w - weeks
    • d - days
    • h - hours
    • m - minutes
    • s - seconds

Supported Operators

=, !=, >, >=, <, <=

Examples

Finding issues that spent more than 2 weeks in "In Progress"

issue > timeInStatus("project = ABC", "In Progress", "2w")

Finding issues that spent less than 3 days in "To Do"

issue < timeInStatus("project = ABC", "To Do", "3d")

Finding issues that spent exactly 5 hours in "In Review"

issue = timeInStatus("project = ABC", "In Review", "5h")

Finding issues that spent at least 2 weeks and 3 days in "Blocked"

issue >= timeInStatus("project = ABC", "Blocked", "2w 3d")

Usage Notes

  • The function processes issues in batches of 100 to optimize performance
  • There is a limit of 2000 issues that can be processed in a single query
  • Time calculation includes the current time if the issue is still in the specified status
  • Time is calculated based on the issue's changelog history
  • If an issue has no status transitions, time is calculated from the issue's creation date

Error Handling

The function will return an error if:

  • Invalid status name is specified
  • Invalid time expression format
  • Subquery matches more than 2000 issues
  • Unsupported operator is used
  • timeExpression - Convert time expressions to seconds for comparisons