disclaimer - I cannot use the SLA default functionality for this exercise so implementing it via automation and custom fields
Hello community!
I'm trying to set different SLA times by comparing creation date of a given ticket vs the timestamp of a transition to a certain status... some calculation use calendar days (24/7) and some use business days (8/5). I need the result to be returned in minutes (as some SLAs counts e.g. 15 mins for response time since ticket creation).
For 24/7 ones Im using the following formula on an if-else block, and triggering an actions based on the result:
- {{issue.created.diff(now).minutes}}
While for 8/5 Im using the following formula:
- {{issue.created.diff(now).businessDays.multiply(1440)}}
The problem Im struggling with is that I need to work with concrete numbers like "SLA: 8 hours since ticket creation" and workdays/hours calendar as Im not able to hit the right formula to calculare exact elapsed time since ticket creation until the condition is met (e.g. status change).
Example: considering working days is Mon to Fri, from 9am to 5pm, for a ticket created at 3pm on a Friday, if the SLA is 8 hours, due datetime should be next monday at 3pm.
In addition, I would like to know if it's possible to set national/local holidays into the formula (configurable).
The resulting number will be compared against the defined SLA.
Thanks in advance for your time/help!