I'm trying to restrict a transition when three conditions are true at the same time:
- the field "Order Parts" has a value of 'Yes'
- the field "Disposition" has a value of EITHER a) 'Rework at OEM & labor $ OEM - (FB)' b) OR 'Rework at OEM - (FR)'
- the field "Parts Ordered" has no value
I wrote the following script which is always stopping the transition. It is not allowing the transition to occur when #3 above has a value. For context, I'm using a post function to apply a value of 'Yes' to the field "Parts Ordered" once the sub-task has been closed.
if (cfValues['Order Parts']?.getValue() == 'Yes' & (cfValues['Disposition']?.getValue() == 'Rework at OEM & labor $ OEM - (FB)' | cfValues['Disposition']?.getValue() == 'Rework at OEM - (FR)') & cfValues['Parts Ordered'] == null){
return false
}