JQL functions (time in status)

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.

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.

"5h35m12s" - 5 hours 35 minutes 12 seconds "5h12s" - 5 hours 12 seconds 3000m - 3000 minutes "0", "0s" ... - time is zero.

Common functions.

General functions work without reference to the "Time in status" field.

  • issue in timeInStatus ("statuses", "condition", "time")

  • issue in timeInStatusByJql ("jql", "statuses", "condition", "time")

  • issue in timeInStatusByJqlAndWokCalendar ("jql", "statuses", "condition", "time", "calendar")

Or their replacement counterparts, in case of functions of the same name in other plugins.

  • issue in timeInStatus_jb ("statuses", "condition", "time")

  • issue in timeInStatusByJql_jb ("jql", "statuses", "condition", "time")

  • issue in timeInStatusByJqlAndWokCalendar_jb ("jql", "statuses", "condition", "time", "calendar")

If you want to use both plugins, go to "Manage Plugins", then expand the modules for either plugin, and selectively enable or disable the JQL function modules for those functions. For example, in "Time in status", the module providing jql-functions is displayed as:

issue in timeInStatus ("statuses", "condition", "time")

  • Returns tasks that spent a certain time in the indicated statuses.

  • The function works in real time.

  • The function takes tasks matching the query "status was in (statuses)" and additionally filters them by condition.

issue in timeInStatusByJql ("jql", "statuses", "condition", "time")

  • It returns tasks from the jql request that spent a certain time in the indicated statuses.

  • The function works in real time.

  • The fewer jql tasks the faster the function works.

issue in timeInStatusByJqlAndWokCalendar ("jql", "statuses", "condition", "time", "calendar")

  • It returns tasks from the jql request that spent a certain time in the indicated statuses. Calculation of time is done according to the specified calendar.

  • The function works in real time.

  • The fewer jql tasks the faster the function works.

Search functions in the "Time in status" field.

Work when search engine is connected (Search template)

"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.

  • It has a limit on the size of the issue.

  • 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.

  • It has a limit on the size of the issue.

  • 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.

Sorting

By the field “Time in status” it is possible to sort. Sorting takes place according to data calculated in real time. Therefore, in large volumes, the request can be processed for a sufficiently long time. If sorting does not occur, you may not have the appropriate rights.

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")

  • "Time in status" in time (">", "1h")

  • "Time in status" in realTime ("<", "1h")

  • "Time in status" in realTimeBetween ("1h", "2h")