Hi All ,
I have a custom field "Target Implemintation Date" which is on the customer screen, I have created a validation on the create Transition that will compare the date it have to be more than 14 days in the future, otherwise it won't create the issue.
I used a "custom Script Validator" with the following code, but nothing happanes, please help.
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def targetDateField = customFieldManager.getCustomFieldObjectByName("Target Implementation Date")
def targetDate = issue.getCustomFieldValue(targetDateField)
if (targetDate) {
def currentDate = new Date()
def futureDate = currentDate + 14
if (targetDate > futureDate) {
return true
}
}
else
{
error ("please change the date ro be at least 14 days in the future")
}