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

Can I get event in post function script Edited

Hello everybody! In script listener it works fine, but in post function error

def eventTypeManager = ComponentAccessor.getEventTypeManager()
def eventTypeName = eventTypeManager.getEventType(event.eventTypeId).getName()

 I suppose that there're no event in post function. But I need to know what happened with issue, closed or resolved and depending on this add comment or not.  Point is that I have one script on two transitions issue resolved and issue closed. In order not to make 2 scripts with slight difference I want to add one script on both transitions and want script to check the event. Is it possible or I have to do script listener or two scripts for different transitions?

1 answer

1 accepted

0 votes
Answer accepted

you can get transition id (or even name) like this:

and base your logic on it

Thanks it works, but what is transientVars there? Is that some collection with all transitions? And how script get exactly desired transition? 

transientVars is what's called "binding variable". basically a map that gets injected in the postfunction and has some transition info, one of which being actionId

Thanks a lot!

Suggest an answer

Log in or Sign up to answer

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