How to access current transition name in a listener?

Hi folks,

 

for auditing purposes, I am currently writing a listener (which will sit on the "Generic event", since this one is called from every transition).

 

The issue I am trying to resolve is - how to get the transition name or ID within the listener code?

 

transientVars is not defined there, so I cannot use transientVars["actionId"]...

 

Any suggestions?

 

Many thanks in advance

Best regards

Dmitri

1 answer

This widget could not be displayed.

There's no transientVars in a listener because the transition is complete by the time a listener picks it up.

That concept is also important with what you're trying to do - listeners only catch events, not transitions.  If you want your listener to do different things on different transitions, then you need to do one of two things:

  1. Use a different event for each transition
  2. In the listener, pick out the issue and read its history.  You still won't get the transition ID directly, but you will pick up the change of status from X to Y.

I'd strongly recommend using the first approach.  Admins like me will have a tendency to go through workflows and change "generic" to more useful events so that we can use notifications and listeners properly.  If I found a listener that relies on "generic event" being fired for everything, frankly, I'd delete it and re-examine the requirement with a view to doing it a sensible way.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

52 views 1 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you