So I need to create a Groovy script where if value X is selected from a checkbox field than a error message comes up saying value Y must be filled in. So essentially if value X is selected then value Y must be filled in, so I thought it would throw a input exception to notify the user however this has not worked and it just says that my condition has failed every time. Could someone give me some advice on how I can fix this script I will attach it bellow. I assume it is something very obvious I missing I think the logic makes sense.
import com.atlassian.jira.issue.fields.CustomField
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
if (cfValues['Roll-off user from']*.value.contains("D4D"))
{
throw new InvalidInputException("If you have selected D4D, please enter a D4D PID!!")
}
return true
At the moment the condition just fails and the transition is blocked. Just to reiterate again if value X is chosen from the checkbox field than a error message should come up alerting the user they need to fill in value Y.
Any help would be appreciated,
Thanks in advance 