Enhanced Search for Jira Cloud

Expression Function

This powerful function compares attributes of fields. Using this script, you can compare the System Estimate and Date fields, and any numeric, date, or datetime custom field.

expression(Subquery, expression)

Logged Work Greater than Estimate

For example, to find issues where more work was logged than originally estimated, use the following:

issueFunction in expression("project = DEMO", "timespent > timeoriginalestimate")

Note that this could be achieved by using plain JQL: workratio > 1. However, with plain JQL, you can not find issues which are likely to exceed their estimate. To do that use the following:

issueFunction in expression("project = DEMO", "timespent + timeestimate > timeoriginalestimate")
Use resolution is empty as the subquery, to filter out issues that have been completed.

To search for issues where the work logged exceeded the original estimate by more than 5 days (normalised for timetracking, so > 40 hours work logged) you would enter:

issueFunction in expression("project = DEMO", "timespent > timeoriginalestimate + 5*wd")
Use 5*d or 5*w and not 5d as in dateCompare - the syntax is different.

Notes on time tracking

When comparing calendar dates, it is useful to think of days as periods of 24 hours. However, when working with time estimates we think in terms of working hours, days (eight hours), and weeks (five days).

You can use working day units:

  • wd - Number of milliseconds in a working day (according to your specification in Admin→Time Tracking)

  • ww - Number of days in a working week multiplied by the value above.

Or, if you are comparing time tracking fields with non-time tracking fields, for example, remaining effort and due date, use the fromTimeTracking function. For example, search for issues which, if their remaining estimate is valid, are going to miss their due date. Using this you can plan to devote extra resources to ensure they don’t run over:

issueFunction in expression("resolution is empty", "now() + fromTimeTracking(remainingestimate) > duedate")

When you specify an estimate of three days, Jira stores that internally as 24 hours, but it appears as three days in Estimate fields. The fromTimeTracking function converts that to 72 hours so it can be used to manipulate and compare with other dates.

Using Custom Fields

Find issues where the product of two number custom fields is greater than X:

issueFunction in expression("project = DEMO", "customfield_10026 * customfield_10028 > 100")

Compare Creator and Reporter

Find issues where the Creator is not equal to the Reporter

issueFunction in expression("project = DEMO", "creator != reporter")

Issues by Complexity

Find issues that have a high ratio of votes to complexity (assuming Complexity is a numeric field):

issueFunction in expression("project = DEMO", "votes / Complexity > 100")