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
Welcome to Atlassian Community!
You do not have to use automation to do this, all you have to do is go and change the calendar used by the SLA so that the calendar is not counting the weekend. Here is an example of the 9-5 workday calendar
If a request is created outside of the defined times the SLA will be paused until the next work day.
Thanks. I'm using a Jira software project and the only settings I can find to control hours are the Time Tracking settings (below). I think your screenshot is from a service project? If not, can you point me to that setting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, your question ended up in the wrong collection then.
The time stamps that you are trying to set are related to time tracking, not SLAs. So are you trying to use time tracking as some sort of SLA? The error you get on the end time is expected since the log work does not allow you to set a future date in it.
In order to use SLAs in Jira Software you would have to either use your own custom fields for the start/end dates or use one if the SLA apps in the Marketplace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mike. Yes I'm using all custom fields. Ultimately the endTimer value is written to a custom field called Due time-date which we monitor in our reporting. I sorry but I don't follow your point about 'the log work does not allow you to set future date in it'.
If the startTimer value is constructed correctly, why does the plusBusinessDays smart value not work?
The last element of my if/else structure doesn't need me to set the value of endTimer since I don't need to account for out of hours. In this step I simply use:
Due time-date = {{issue.created.PlusBusinessDays(3)}}
and that works fine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, because you included the screenshot of the time tracking feature I assumed you tried to use those date fields.
So are startTimer and endTimer both variables? The reason that {{startTimer.plusBusinessDays(3)}} is not working could be that you need to convert it to a date format that Jira understands. You could try and add .jiraDate at the end to see if that returns a value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.