I am desperately trying to compare 2 dates from custom fields in the issue screen, but nothing happens and I can't find the problem in my code:
-------------------------------------------------------------------------
def StartDateField = getFieldByName("Start date")
def EndDateField = getFieldByName("End date")
Date StartDateValue = (StartDateField.value as Date)
Date EndDateValue = (EndDateField.value as Date)
if ( StartDateValue.getTime() > EndDateValue.getTime() ) {
EndDateField.setError("EndDateValue cannot be earlier than StartDateValue")
} else {
EndDateField.clearError()
}
-----------------------------------------------------------------------
Your help will be much appreciated!