Time spent between two status

Hi All

I need help with a JQL query. Need the time spent only between the status of ‘Reopened’ and ‘Complete’ for certain user stories. I was trying this query but it is  not working, but you can get the logic of what I need highlighted in red:

 

project = XXX and component=yy and sprint in (1386, 1387, 1388, 1597, 1673, 1674, 1675, 2116, 2211) and status changed to reopened during (startOfYear(), endOfYear()) and issuetype=story and timespent in (status between (reopened and complete))


Query is throwing a syntax error. Don't know if it is going to work though. Need any advice on how to get the results

2 answers

I don't think this will work. As I understand it the timespent function returns the time logged on an issue and you can't slice and dice it by time period.

When you say you are looking for the time spent between the status of 'Reopened' and 'Complete' do you mean the time logged? Or do you mean the duration between transitioning to Reopened and transitioning to Complete?

In either case you could create custom fields and use post-functions on the relevant transitions.

You would benefit from the the JIRA Misc workflow extensions plugin for this. 

Basically copy the value (time logged or current time) to a custom field (e.g. called Custom Time Stamp) on the Reopened transition.

Calculate a value using a groovy statement to subtract the value in Custom Time Stamp from the current value and copy this to another custom field on the Complete transition. This will be the time logged / duration between the statuses.

 

Hi Chris Dunne,

Thanks for your comments. This is really helpful. I actually meant the time logged between 'Reopened' and 'Complete' by an assignee and not the duration of the transition.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

776 views 5 17
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot