I want to set another field to be required according to the change of one date field. When the date field changes from a certain date to null, another field cannot be triggered to be required。
explain:on this date Fields ,implement behavior
code as follows:
def timeField = getFieldById(getFieldChanged())
def formField = getFieldById("comment")
def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("执行时间")[0]
def currentDate = (underlyingIssue?.getCustomFieldValue(cf) as Date)?.dateString
if ((timeField?.value as Date)?.dateString != currentDate){
formField.setRequired(true)
}
else
{
formField.setRequired(false)
}
thanks for your response