I’m trying to write a JQL query to find tickets that got closed quickly after they were opened. Basically I want to search for issues where the time between creation and resolution is less than a certain period.
What I’m looking for:
Something like resolution_date - creation_date < '7d' to find tickets resolved within a week.
Example scenario:
I have these three tickets:
Ticket A: opened 3 days back, closed 2 days back (took 1 day to resolve)
Ticket B: opened 6 days back, closed 2 days back (took 4 days to resolve)
Ticket C: opened 4 days back, closed yesterday (took 3 days to resolve)
If I search for tickets resolved within 2 days of creation, I should get Ticket A only. How can I build this kind of query in Jira?
I ran into this exact problem when tracking our team’s bug fix velocity. Since JQL lacks native date arithmetic, I ended up creating a saved filter that combines time-based searches with manual verification. My approach was to use resolved >= startOfDay(-7d) AND created <= endOfDay(-7d) to get a broader dataset, then manually check the actual resolution times. This worked well for periodic reports but required some manual effort. Another option that helped was setting up a dashboard gadget that shows average resolution time, which gave me insights into patterns without complex queries. If you need this regularly, investing in a reporting addon might be worth considering since the manual approach becomes tedious for frequent analysis.
JQL does not allow for direct date arithmetic like resolution_date - creation_date < '7d', which can be frustrating. One effective workaround is to utilize scripted fields if you have access to tools like ScriptRunner. You can calculate resolution time by creating a custom field that computes the difference in days, using something like (resolved.time - created.time) / (24*60*60*1000). For reporting purposes, consider exporting the data to Excel or leveraging Jira’s REST API, which provides greater flexibility for performing complex calculations that JQL cannot accommodate.
unfortunately jql doesnt support date math operations natively but theres a workaround. try using resolved >= -7d AND created >= -7d to narrow down results first, then export to analyze the actual timeframes. some third party apps like eazybi can handle this calculation better if your organization has them installed.