Hai,
How to count the number of times that the issues comes to the same status in script runner for jira or using groovy script.
You could create a custom field to record number of transitions and increment it in transitions to the required status.
Finding workflow steps in history is more involved.
You will need to go through the Change History looking for changes in status. You will need to check old and new values to identify a particular transition.
List<Issue> issues = new ArrayList<Issue>();
issues.add(currentIssue);
List<String> fields = new ArrayList<String>();
fields.add("status");
// fields.add("Status");
List<ChangeHistory> transHist = chgManager.getChangeItemsWithFieldsForIssues(issues, fields);
for (ChangeHistory change : transHist) {
List<ChangeItemBean> cha = change.getChangeItemBeans();
for (ChangeItemBean item : cha) {
if (item.getField().equals("status")) {
UserHistoryEvent event = new UserHistoryEvent(change.getAuthorDisplayName(),
change.getTimePerformed(), "Transition", change.getId());
addEvent(event, event.eventDate);
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.