I'm trying to set up a ticket SLA based on 3 working days so:
- if it's opened on a Friday after 5.30pm, Saturday or Sunday the clock 'starts' at 9am on Monday.
- if it's opened after midnight but before 9am, the clock starts at 9am the same day
- if it's opened after 5.30pm, the clock starts at 9am the next working day.
I've worked out the logic for each if/else block in order to calculate the 'startTimer' value in each scenario and have been using Log Action to print the relevant values to the log so I can confirm each works correctly. The routine is failing each time I try to set the endTimer - 3 business days after the startTimer value. An example is below using values from the log.
Issue created: 2024-05-30T18:24:47.4+0000
As this is after hours, the startTimer value is calculated as:
startTimer = {issue.created.plusDays(1).withHour(9).withMinute(0)}}
and the correctly logged value is:
startTimer = 2024-05-31T09:00:47.4+0000
Use plusBusinessDays to set the end timer and it fails to return a value
endTimer = {{startTimer.plusBusinessDays(3)}}
endTimer returns as null
The automation shows that it has been executed successfully. What am I missing in the way I use the smart value? thanks