Hi Team,

def errorText = "For the Ticket Type Bug, if the Sprint field is set, the Fix Version/s and Release Date are mandatory. "
def sprintField = getFieldByName("Sprint")
def fixField = getFieldByName("Fix Version/s")
def releaseField = getFieldByName("Release Date")
def sprintValue = sprintField.getValue()
if (sprintValue != "")
{
releaseField.setRequired(true)
fixField.setRequired(true)
releaseField.setError(errorText)
fixField.setError(errorText)
}
else
{
releaseField.setRequired(false)
fixField.setRequired(false)
}
I need to ensure that the "fix version" and "release date" fields are mandatory when the "sprint" field is not empty. I've attempted to achieve this using the following ScriptRunner behavior. When we populate the sprint value and provide values for the fix version and release date fields, it's displaying an error. Is there something wrong with this script? This script is commonly used in various scenarios.