Condition on a custom field basis for triggering behaviour?

Sandra Meessen July 23, 2018

Hello, I want to trigger my "behaviour" based on the value of a custom field "estimate type". In case this field is empty I want to fire BehaviourA and in case this field is filled I want to fire BehaviourB.

In the setup for Behaviours I can add a "condition" for every field in my behaviour, but all conditions are based on CurrentUser, WorkflowStep or WorkflowAction, not on custom fields (see attached screenprint). How do I define my condition "When Estimate Type is empty", than "fire my BehaviourA"? Thanks.Conditions on Behaviour.JPG

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
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.
July 23, 2018

Hello,

You should write a code to do this. You add the estimate type field to the behaviour. And the you can check if the field is empty like this:

def estType = getFieldByName("estimate type")

if (estType.getValue() == null) {
// the field is empty
}
Luke Galardi December 10, 2018

Alexey, i have many dozen fields in a form, each of them has a behaviour associated.  I am concerned that every behaviour will be evaluated when I choose an option on a field.  Is this true?  Does every behaviour in a form get evaluated each time a field value is entered, with only the one(s) satisfying the behaviour being triggered?

If so, how do I best limit cpu processing on fields which are not in the current context?  I have many fields with Yes / No Radio buttons.  Based on the option chosen, another field will be hidden or shown.  What do you suggest?  One long behaviour script for all of these fields, or individual behaviour scripts that may somehow be limited in scope when certain actions are taken?

Many Thanks

 

Luke

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events