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

This widget could not be displayed.

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
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 Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

576 views 25 15
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