Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I count how many times a transition has been visited?

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!

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

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.

Thank you! Your answer really helped me.

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

Thank you for your quick help!

How can I access the data in the "Transition" Tab to use it in Java Source Code?

TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

473 views 6 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you