I am a new user, so I don't know script well.
I know && when both conditions are satisfied, however I want a script using A condition or B condition or A condition & B condition. In sum, script has to satisfy below cases.
case1) cfValues['A']?.value == 'Yes'
case2) cfValues['B']?.value == 'Yes'
case3) cfValues['A']?.value == 'Yes' && cfValues['B']?.value == 'Yes'
In addition, field A and B can be null. So, if value is null, Jira hasn't prevent transition.
I tried below, but it doesn't work correctly.
import com.opensymphony.workflow.InvalidInputException
if (!cfValues['A'] && !cfValues['B'])
{cfValues['A']?.value == 'YES' && cfValues['B']?.value == 'YES'
}
else {
throw new InvalidInputException("A & B are not YES")
}
if (!cfValues['A'] && cfValues['B'] )
{ cfValues['A']?.value == 'YES'
}
else {
throw new InvalidInputException("A is not YES")
}
if ( cfValues['A'] && !cfValues['B'] )
{ cfValues['B']?.value == 'YES'
}
else {
throw new InvalidInputException("B is not YES")
}
if ( cfValues['A'] && cfValues['B'] )
{ cfValues['A']?.value == '' && cfValues['B']?.value == ''
}
else {
throw new InvalidInputException("")
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.