HI,
I have two custom fields in create issue screen. my requirement is making one custom field required based on another custom field. so i kept some groovy script code in validator for that Transition. So it is working fine in create issue screen.
But now i want same validation for the Edit screen. Where to put the code for the Edit screen. because it does not have transition (Edit screen not comes under workflow).
My groovy script is
import com.opensymphony.workflow.InvalidInputException
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
ComponentManager componentManager = ComponentManager.getInstance();
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
CustomField IPRelease = customFieldManager.getCustomFieldObject("customfield_12136");
CustomField IPRecipient = customFieldManager.getCustomFieldObject("customfield_12137");
String IPReleaseval = (String)issue.getCustomFieldValue(IPRelease);
String IPRecipientval = (String)issue.getCustomFieldValue(IPRecipient);
if (IPReleaseval == "Yes") {
if (IPRecipientval == null) {
InvalidInputException e= new InvalidInputException();
e.addError("IP Recipient must not be empty");
throw e;
}
}
Please help me to solve this.
Thanks in advance