Hi Team,
Here I'm creating a script fields
> The total Time Status in Particular Status. here is the script Can any one help in my script that its calcualting the Milleseconds I need like proper Time Format and days.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def inProgressName = "X"
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
Its counting in total seconds
Is there any chance to count if the ticket is been in that status like 7 days in that particular ticket so that i can add that in column report.
can any one suggest me please.
thanks,
Kumar