Hello,
We are using script runner scripted custom field that counts the all used transitions from open to resolved status.
For example if we had transitions A,B and C from open to resolved status the present script counts the all 3 used transitions but i need only "A" transition count only can any one please help with the script to count only "A" transition.
Here the script below
import com.atlassian.jira.component.ComponentAccessor
//Fetching the Issue History objects and filtering it to 'status' field, which reflects the Status changes
def changedStatus = ComponentAccessor.getChangeHistoryManager().getAllChangeItems(issue)?.findAll {it.field == "status"}
def result = changedStatus.findAll{
(it.froms["1"] && it.tos["5"])
//For each fetched entries, check if the 'from' (source) and 'to' (destination) statuses match the configured IDs
}
result.size() //Returns the count of the result of the matched IDs
Thanks in advance,
Siva.