Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Behavior to require one of three custom fields not be null

I have a behavior that checks the value of a custom field and determines if other custom fields should be visible.  There is an initializer that hides them initially.  In addition, it checks that at least one of the three custom fields is not null. 

The code below works in throwing the error, but once the user enters a value for one of those fields, the error does not go away and the issue cannot be updated.  I'm not sure what I'm doing incorrectly.  Any help is appreciated!

 

def Cust_fieldValue = Cust_fieldID.getValue()
def SIE_fieldValue = SIE_fieldID.getValue()
def CFI_fieldValue = CFI_fieldID.getValue()
def SFDC_fieldValue = SFDC_fieldID.getValue()

if (Cust_fieldValue == "Yes") {
SIE_fieldID.setHidden(false)
     CFI_fieldID.setHidden(false)
     SFDC_fieldID.setHidden(false)

     if (!SIE_fieldValue && !CFI_fieldValue && !SFDC_fieldValue) {
          Cust_fieldID.setValid(false)
          Cust_fieldID.setError("An SIE, CFI or SFDC is required")
     }
    else {
         Cust_fieldID.setValid(true)
         Cust_fieldID.clearError()
     }
}

 

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Adrien Low _ServiceRocket_
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.
Dec 24, 2021

Hey @jonathan.fears ,

If the above script is placed only in your Initialiser, the script would only run once upon screen load while in the Create/Edit screen.

Which is why subsequent edits to your other custom fields will not do anything.

You will probably need to configure a script for each custom fields separately so that it could detect whenever changes are made to a custom field.

Regards.

TAGS
AUG Leaders

Atlassian Community Events