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.
Hello @Vivek Singh , can you confirm if you have Scriptrunner installed on your instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sachin Yes we have the script runner, could you please help how i can use it to establish this requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.