Hi Team,
I want to make a field "Read-Only" based on the value of another field. However, the field is completely disabled for other values during creation. Please review the behavior below and let me know if I've missed anything.
The fields are : Need By Date, Requester Dept.
The "Need By Date" should be read-only upon creation when the "Requester Dept." has specific values. I have added this behavior using the "Requester Dept." field.
Please check the attached screenshots for your refence.


import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def dateField = getFieldByName("Need By Date")
def rdField = getFieldByName("Requester Dept.")
def rdValue = rdField.getValue()
if ((getActionName() in ["Create Issue", "Create"]) && (rdValue == "APAC Fulfillment Implementation" || "APAC Support" || "APAC System Automation Implementation"))
{
dateField.setReadOnly(true)
}
else
{
dateField.setReadOnly(false)
}