I would like to develop a plugin which counts the times an issue has visited a certain transition. Unfortunately I have no clue how to do this.
Source Code is highly welcome!
Community moderators have prevented the ability to post new answers.
You don't need that plugin to do this. Instead, you can:
int numberOfTimesInThisStatus = 0; String nameOfWorkflowStatus = "myStatus"; String previousStatus = "previousStatus";
for (ChangeHistoryItem item : changeHistoryManager.getAllChangeItems(myIssue)) { if (item.getField().equals("status") && item.getTos().containsValue(myStatus) && item.getFroms().containsValue(previousStatus)) { numberOfTimesInThisStatus++; } }
Where "myStatus" is the name of the Workflow step you want to count and "previousStatus" is the name of the step from which the transition to "myStatus" originated. (If you don't care about the specific transition, just delete that line.) "status" in the code is a literal - it's the name of the 'Status' field in the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peter,
The suite Utilities Plugin is what you are looking for.
It keeps a tab of number of times the issue has been in a transition and the time spent in the same.
let me know if it helps
Amrut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your quick help!
How can I access the data in the "Transition" Tab to use it in Java Source Code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.