Jon
Jon

Reputation: 1047

Jira Query on how long an issue was on a particular status

I want to do a Jira issue query, but I dont know if it is possible.

I am looking at how many of our bugs have been re-opened ever. So they were worked on, closed, re-opened, and then fixed and closed again. Its a measure of how well bugs are fixed.

That query uses:

AND status was Reopened

However, we have a behaviour where we close an issue, realise that the issue needs editing, so re-open the issue to change the resolution for example, and then close it again.

I think the best way of doing this is to search for something like

'AND status was Reopened for more than 3 hours'

Is there anything like that? The data is there in the history, it is just a matter of weather we can query it or not.

Upvotes: 2

Views: 1302

Answers (2)

Nihal Gupta
Nihal Gupta

Reputation: 208

So, JQL alone does not support querying how long an issue stayed in a particular status. But you can achieve this using Jira Automation:

  1. Create a custom field (e.g., Time in Reopened).
  2. Use Jira Automation to start a timer when an issue moves to Reopened and stop the timer when it transitions Out of Reopened and store the duration.
  3. Query issues where Time in Reopened > 3h.

Upvotes: 1

chzwhz
chzwhz

Reputation: 46

There's no way to write a JQL for issues which were in a status for a given amount of time. JQL only supports searching the time an issue has been in a status relative to a date. If you are using Jira Service Desk, the usual workaround for something like this is to create an SLA for 3 hours which is triggered when the issue moves into the Reopened status, and then query for this SLA being breached.

Otherwise, there are add-ons for adding this functionality to JQL. Or add-ons for creating automations which could set a flag that you could query. Automation for Jira and Scriptrunner are popular plugins that could pull this off, and soon Automation for Jira will be built into Jira Cloud.

Upvotes: 1

Related Questions