Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to show the no of days the issue is being worked on ?

Vivek Singh July 12, 2020

I have got a requirement where we want to capture the no of days an issue is being worked on.

We need the time noted only for the transition and as soon as the workflow changes the time is reset and start counting the other transition time.

4 answers

2 accepted

0 votes
Answer accepted
Sachin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2020

Hello @Vivek Singh , can you confirm if you have Scriptrunner installed on your instance.

Vivek Singh July 12, 2020

Yes we have the script runner

Vivek Singh July 12, 2020

@Sachin Yes we have the script runner, could you please help how i can use it to establish this requirement

Sachin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2020

You can create a scripted field that displays the duration of "in progress" status for a ticket. There are also few inbuilt scripted fields like "Time in Status" which displays the date and time that the issue last had its status changed.

You can use below script for "duration of in progress"
 As jira admin
goto settings (cog) -->Manage apps -->  Scriptrunner --> Fields --> Create script field --> Duration in progress --> and chose duration as template -->  place below script in the Script

Below script works for jira 8 and later.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean

def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()

def inProgressName = "In Progress"

List<Long> rt = [0L]
def changeItems = changeHistoryManager.getChangeItemsForField(issue, "status")
changeItems.reverse().each {ChangeItemBean item ->
def timeDiff = System.currentTimeMillis() - item.created.getTime()
if (item.fromString == inProgressName) {
rt << -timeDiff
}
if (item.toString == inProgressName){
rt << timeDiff
}

}

def total = rt.sum() as Long
return (total / 1000) as long ?: 0L

 Screenshot_2.png

Like • Vivek Singh likes this
0 votes
Answer accepted
Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2020

Hi @Vivek Singh 

You can use the Time in status add-on which counts how long an issue was in a specific status.

I hope this helps.

2 votes
Gökçe Gürsel {Appfire}
Atlassian Partner
July 13, 2020

Hi @Vivek Singh ,

This is a classic use case for Time to SLA.

You can set up an SLA to start with issue creation and end with the transition you mentioned. So when this transition happened you can see how many days the issue has been worked on in the SLA Overview tab.

SLA Overview.png

You can extract these values using our Groovy scripts as well. We can assist you with that.

About the workflow change and SLA reset requirement, it's easy to configure with Time to SLA.

It has different reset options and you can define SLAs for different workflows.

image2020-7-10_12-46-36.png

We can this your use case over a demo session if you wish. Let me know if you have any questions, I'd be happy to assist you.

Regards,

Gökçe

Vivek Singh July 13, 2020

Hi @Gökçe Gürsel {Appfire} 

 

Thank you for your answer but we are looking more into capturing the time only an issue has been on that transition with the help of a simple custom field.

1 vote
Mariana_Pryshliak_Saasjet
Atlassian Partner
July 13, 2020 edited

Hello @Vivek Singh 

You can try Time between Statuses. This add-on generates reports of the transition time between statuses. Concerning your issue, you can set start/pause/stop statuses to calculate transition time between statuses. Also, you can configure Warning and Critical Time limits for each Status Group.

So you can monitor the time both in one status or for Status Groups. 

If you have any additional question, I'm here to help you))

 

 tbs startstop timers.png

Suggest an answer

Log in or Sign up to answer