Custom script for multiple If conditions

Good day

I am busy trying to make a custom script but it fails when i run it.
it is a big IF statement with 5 Boolean variables.

i can’t get it to run without failing. is there something I’m missing?

@CustomScriptAction(
    input = ['failcheck1','failcheck2','failcheck3','failcheck4','failcheck5'],    
    output = 'finalfailcheck'             
)

def customScript() {
    
    if( (failcheck1) == (RBoolean.fromCanonical('true')) || (failcheck2) == (RBoolean.fromCanonical('true'))
     || (failcheck3) == (RBoolean.fromCanonical('true')) || (failcheck4) == (RBoolean.fromCanonical('true')) 
     || (failcheck5) == (RBoolean.fromCanonical('true'))){
    
       finalfailcheck = RBoolean.fromCanonical('true')
    }else{
       finalfailcheck = RBoolean.fromCanonical('false')
    }
1 Like

@ivan.swiegers you custom script is correct, it is just missing the closing bracket

@CustomScriptAction(
input = ['failcheck1','failcheck2','failcheck3','failcheck4','failcheck5'],
output = 'finalfailcheck'
)

def customScript() {

if( (failcheck1) == (RBoolean.fromCanonical('true')) || (failcheck2) == (RBoolean.fromCanonical('true'))
|| (failcheck3) == (RBoolean.fromCanonical('true')) || (failcheck4) == (RBoolean.fromCanonical('true'))
|| (failcheck5) == (RBoolean.fromCanonical('true'))) {

finalfailcheck = RBoolean.fromCanonical('true')

} else {

finalfailcheck = RBoolean.fromCanonical('false')
}

} 

I think a lot of users would find a script for multiple conditions very helpful. Feel free to share it if you want to.