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);
}
}
}
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️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.