Can I use getDestinationStepName() in Behaviour Plugin when the transition is global?

Hi, 

I've defined a Global transition named "X" associated to the window "WindowX". This window has 3 customfields "CF1", "CF2" and "CF3".

This global transition is defined as follows:

Name: X

Description:

Destination step: The source step 

View: WindowX

 

I need to configure which customfield must be shown in WindowX depending on the status on which the transition is launched.

I've tried to configure Behaviour plugin in this way:

CF1       is associated to a validation script:

if(getActionName() == "X" && getDestinationStepName() != "En Entrega"){
getFieldByName("CF1").setHidden(false);
}

if(getActionName() == "X" && getDestinationStepName() == "En Entrega"){ 
getFieldByName("CF1").setHidden(true);
}

But, when I launch the action "X" from the "En Entrega" status (where the destination step is "En Entrega"), the customfield "CF1" isn't shown.

All help is welcome!!

 

Begoña

1 answer

1 accepted

1 vote

I'm not sure why you need to check the destination step name. If the action name is X, and it's a global action you know the destination step name. So you could check the current step name in conjunction with the action name.

That said, getDestStep uses the OSWorkflow API, so if it doesn't give you a destination step for a global action there's not much I can do.

 

I'll try to explain why I need to know the name of "Destination step": I've defined the Global Transition using the option "The source step" to define the value of the "Destination step" property. Is for this reason that I can launch this transition in every status in the flow, without changing the step (the source step=the destination step): To know the name of the action isn't enough for knowing the destination step because it depends on the step on which the action has been launched. Thanks Jamie, I'll find another solution for this scenario. Begoña

> To know the name of the action isn't enough for knowing the destination step because it depends on the step on which the action has been launched. Yes, but what I said was "the action name AS WELL AS the current step name". From those two you can know the destination step... which for this action is the source step.

Yes you are rigth, if I don't use global transitons the problem is solved. Thanks

I didn't say not to use global transitions, but OK...

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Service Desk

Wy are we still using email for Service Desk workflows?

...attest to the experience of an urgent approval that gets lost in the boss’s inbox and requires that special “Please Approve” email or text message. In an age where we have distributed teams...

111 views 0 2
Read article

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