I'm using a scripted condition on a workflow transition which only allows the transition if:
- The FixVersion field is empty OR
- The current time/date > FixVersion Start Date + 9h
The script I am using is as follows:
import java.sql.Timestamp
def today = new Timestamp(new Date().time)
def branch
def fixVersions = issue.fixVersions
if(fixVersions){
if(fixVersions*.startDate == [null]){
return true
}
def branchDate = fixVersions[0].startDate
branchDate.setHours(branchDate.getHours() +9)
branch = new Timestamp(branchDate.time)
}
if (today > branch) {
return true
} else {
return false
}
Expected Result:
If the FixVersion Start Date is set to Jan 13, 2022, the condition should be TRUE after 9am on Jan 13, 2022.
Actual Result:
If the FixVersion Start Date is set to Jan 13, 2022, the condition is TRUE after 9am on Jan 14, 2022.
Any ideas what I may be doing wrong?