I have the following query in Jira DC that returns a list of all of the issues where Original Estimate is less than the 'Hours In Developing' field, which is a number field
issueFunction in expression("", "fromTimeTracking(originalestimate) / 3600000 < HoursInDeveloping")
I have confirmed that this works correctly in DC, but we are migrating to Cloud and the function cannot be converted using Scriptrunner Enhanced Search.
I have tried using the 'Ask AI' feature to show issues where the value in the Original Estimate field is less than the value of the Hours In Developing field (and other equivalent asks), but it was.....not particularly helpful.
Is there any way in Cloud to write a JQL query that will compare the values in two number fields?
Hi @Matt Parks,
There is no equivalent native Jira Cloud JQL for this comparison. Atlassian explicitly states that JQL cannot compare one field with another. The expression() function is provided by ScriptRunner on Data Center, so its availability in Cloud depends on the app rather than Jira’s native JQL.
A native Cloud workaround is to maintain a helper field with Automation:
You can then use normal JQL such as "Estimate below Hours in Developing" = Yes. Run the rule once on a schedule to populate existing work items, then let the field-change trigger maintain it. Atlassian documents the JQL field-comparison limitation and the available Automation comparison conditions.
Hola Matt,
There isn't a direct equivalent to ScriptRunner Data Center's expression() function in either native Jira Cloud JQL or ScriptRunner Enhanced Search for Cloud. Native JQL can compare a field with a fixed value or supported function, but it can't compare the value of one field directly with another.
The automation-based helper field already suggested is the most practical native Cloud approach. One refinement would be to use a numeric field, such as Estimate Variance Hours, instead of a Yes/No field. Automation could calculate Hours In Developing minus Original Estimate in hours, and you could then search with normal JQL, such as:
"Estimate Variance Hours"> 0
That also gives you the option to sort or report on the size of the variance rather than only identifying whether one exists.
The rule would need to run whenever either source field changes, and you'd need a one-time scheduled rule to populate the helper field for existing work items. I'd also add handling for cases where either field is empty, so stale values aren't left behind.
Atlassian confirms the field-to-field limitation here.
Thanks,
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.