This is about a validator in a workflow for the create issue event, a Simple scripted validator.
There is a Start Time which the user has to set on the Service Desk page when opening the ticket. The user can select a Start Time for tomorrow only until 12 noon of the day of opening the ticket. If it's past noon, they can only select a Start Time for the day after tomorrow.
First I tried to compare the Start Time to the current time
import java.sql.Timestamp
def starttime = cfValues['Start Time']
def noticket = new Timestamp((new Date()).getTime())-(1000*60*60*12*1)
starttime > noticket
Or compare them by substraction:
(cfValues["Start Time"].time - (new Date().getTime()) / 86400000)/43200000
Or would it be something like this here?:
https://community.atlassian.com/t5/Jira-questions/Is-there-a-Script-Runner-condition-to-check-created-date/qaq-p/306878
Thanks in advance!