How can I know from which transition has been invoked my groovy script?

Begoña Bonet April 28, 2015

Hi,

My scenario:

2 transitions which launch the same groovy

I need to know from which one the script has been launched to include a piece of code like this:

 

If (invoked_from_transition1){

do_1;

else{ do_2;

}

 

Any idea?

Thanks in advance

 

Begoña

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2015

The action ID is in the transientVars map which is in the script binding. 

def workflow = componentManager.getWorkflowManager().getWorkflow(issue)
def wfd = workflow.getDescriptor()
def action = wfd.getAction(transientVars["actionId"])
def actionName = action.getName()


0 votes
Peter Bengov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2015

You can add log events to the code. This might cause a lot of "garbage" in your log file, but I would try it.

Add log.warn("message") or log.debug("message") before each relevant do

TAGS
AUG Leaders

Atlassian Community Events