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: “>”.
- time - time string corresponding to one of the patterns.
"5h12s" - 5 hours 12 seconds
3000m - 3000 minutes
"0", "0s" ... - time is zero.
- calendar - the name or ID of the calendar. For example: “Support” or “1”. How to view calendars?
Common functions
General functions work without reference to the “Time in status” field. Having no field, they have no index entry either: they are computed from issue history on every run, under the limits on the JQL performance settings page. The field-based functions behave differently - see Live value vs. indexed value.
- issue in timeInStatus (“statuses”, “condition”, “time”)
- issue in timeInStatusByJql (“jql”, “statuses”, “condition”, “time”)
- issue in timeInStatusByJqlAndWorkCalendar (“jql”, “statuses”, “condition”, “time”, “calendar”)
If a function name clashes with a function of the same name from another app, go to Manage apps, expand the modules of one of the two apps and disable the module that provides the conflicting JQL function.
issue in timeInStatus (“statuses”, “condition”, “time”)
- Returns issues that spent a certain time in the indicated statuses.
- The function works in real time.
- The function takes issues matching the query “status was in (statuses)” and additionally filters them by condition.
issue in timeInStatusByJql (“jql”, “statuses”, “condition”, “time”)
- It returns issues from the JQL request that spent a certain time in the indicated statuses.
- The function works in real time.
- The fewer JQL issues, the faster the function works.
issue in timeInStatusByJqlAndWorkCalendar (“jql”, “statuses”, “condition”, “time”, “calendar”)
- It returns issues from the JQL request that spent a certain time in the indicated statuses. Time calculation is done according to the specified calendar.
- The function works in real time.
- The fewer JQL issues, the faster the function works.
Examples
- issue in timeInStatus (“NEW”, “>”, “1h”)
- issue in timeInStatus (“10000”, “>”, “1h”)
- issue in timeInStatus (“10000, 10001”, “<”, “1h5m”)
- issue in timeInStatusByJql (“project = TEST”, “10000, 10001”, “<”, “1h5m”)

