I have two custom date fields: Start Date and End Date.
I want to check if End Date is set before Start Date in which case I want to stop ticket creation and let the users know that End Date cannot be set before Start Date.
I do have scriptrunner, but I didn't find a straightforward solution.
Hi @Bojan Virag
you could use a custom script condition with the following code:
def cfStartDate = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName("Start Date").first()
def cfEndDate = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName("End Date").first()
def startDate = issue.getCustomFieldValue(cfStartDate) as Date
def endDate = issue.getCustomFieldValue(cfEndDate) as Date
passesCondition = (startDate != null && endDate!= null && startDate <= endDate)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event