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

Condition tester code

Junaid Shah
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.
February 26, 2015

Hi,

Im trying to use the Condition Tester by checking whether three different select list have been selected. E.g. Atleast one select list needs to be chosen to progress onto transition.

 

I've got something like this:

 

if (cfValues[13614] != 'None') {return true} else {return false};  

if (cfValues[13616] != 'None') {return true} else {return false};

but its not working properly as even though value is None it still shows as True.

 

Any help is appreciated.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
JamieA
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.
February 26, 2015

cfValues is indexed by field name. "None" is just what's displayed when the value is empty (ie null). So to check any of three select lists are filled you could use

cfValues["1st select"] || cfValues["2nd select"] || cfValues["3rd select"]
Junaid Shah
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.
February 26, 2015

Thank you so much, could you just explain the code as Im a beginner and this would help me learn further what do the || do etc. thanks again.

Udo Brand
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.
February 26, 2015

The expression 'cfValues["1st select"]' returns true if in this select list is a value - it returns false if empty. || is the OR operator.

Junaid Shah
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.
February 26, 2015

Thanks Udo!

TAGS
AUG Leaders

Atlassian Community Events