It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi,
I was hoping someone can help me with the following.
We've created a new Hierarchy as followed: Initiative - Epic - Story
What I would like to do is track how long it took for an Epic to get resolved. The tricky part is to measure Epics when they have an Initiative.
In short:
When an Epic has an Initiative the start date would be the transition of the Initiative to In progress and the end date would be when the Epic is resolved.
Else
When an Epic doesn’t have an Initiative the start date would simply be the transition of the Epic to In progress and the end date would be when the Epic is resolved
Would this be possible with Script Runner and can I use the following Script from Adaptavist as a basis?
import com.atlassian.core.util.DateUtils
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.history.ChangeItemBean
def componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
def inProgressName = "In Progress"
def rt = [0]
changeHistoryManager.getChangeItemsForField (issue, "status").reverse().each {ChangeItemBean item ->
def timeDiff = System.currentTimeMillis() - item.created.getTime()
if (item.fromString == inProgressName) {
rt << -timeDiff
}
if (item.toString == inProgressName){
rt << timeDiff
}
}
// NOTE: doesn't show anything if less than 60 seconds
DateUtils.getDurationString(Math.round(rt.sum() / 1000))
I know we can measure time with the Time in Status plugin but the plugin doesn't fit the need that I have.
All help is much appreciated!!
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs