Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

When do script Runner Behaviors fire?

Nannette Mori
Contributor
October 25, 2022

Script Runner Version 6.56

We created a behavior to check for a valid fix delivery.  We also have a sil validator checking for a valid delivery on each of our transitions.

We added the behavior to check for valid fix delivery to stop users in-between transitions updating the fix version back to an invalid Fix delivery.  

If the user tries to update the Fix delivery field back to 6.x from the view screen it takes the user to the edit screen and throws an error "to select a valid Delivery".  If I am transitioning to another state I would expect the sil validator I have on the transition to fire if the Fix delivery is Invalid, but the sil validator is not firing.  So if I select a transition to move to the next state and I try to change to an invalid Delivery the Behavior script is firing(I know because the messages are different) instead of the validator that is on the transition.  In the behavior we do have it checking the state and if the state is "In Progress" and fix Version contains a .x it will throw a message.  So my question is why is the Behavior firing on the transition instead of the validator I have on the transition.  My understanding is for script runner you would need to have a Behavior and a validator when validating a field value??

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
PD Sheehan
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.
October 26, 2022

Behaviours are evaluated every time a screen dialog is open. That's true for Create screen, Edit screen or any transition screens.

Workflow Validators fire when you submit a transition form (or immediately if no screens are associated with the transition).

It's possible to use getActionName() in your behaviour to see if you are using a transition or not and perhaps bypass the validation then.

DEPLOYMENT TYPE
SERVER
VERSION
8.22.6
TAGS
AUG Leaders

Atlassian Community Events