JQL Query: Is there a way to query the following in JQL?

Per Epic
Total number of issues (completed/not completed)--- no. of hours used to complete per Issue (per Epic total) – Issues/hours that were underestimated/overestimated -- planned/unplanned Issues and hours breakdown (%) etc. –

I tried the following and couldn't make it work as there is a limitation in using variables in JQL. Please let me know.

project = <MY_PROJECT> AND status in (Open, "In Progress",Resolved, Done) AND remainingEstimate != originalEstimate ORDER BY "Epic Name"

ERROR : The value 'originalEstimate' for field 'remainingEstimate' is invalid. Please specify a positive duration format; for example: '1h 30m', '2d'.

Based on the error, I see the remainingEstimate and originalEstimate must be mentioned as variables inorder for the get the values for the respective variables. I couldn't get lucky using variables using $ or another expression.

Note : Above query is incomplete, as the syntax error didn't let me to write filters for remaining metrics to proceed further

2 answers

This widget could not be displayed.

You can't compare fields in JQL like that - if you have Script Runner use the expression function.

This widget could not be displayed.

SQL for JIRA also supports comparisons based on regular and custom fields among any other JIRA data. Example:

select i.key
from issues i
where JQL=' project = &lt;MY_PROJECT&gt; AND status in (Open, "In Progress",Resolved, Done) ORDER BY "Epic Name" ' 
and i.originalestimate = i.remainingestimate

 

Then convert back the SQL above into a JIRA JQL:

issue in sql("<the SQL for JIRA query above>")

 

 


Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

207 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you