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:
While for 8/5 Im using the following formula:
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!
First thing, please check your site settings for your business hours to confirm the start/end of the business day.
Next, you appear to be multiplying by 1440 which is the number of minutes in 24 hours, not 8 or 9 hours, or however long your work day is by the settings.
Regarding the holidays, I believe those (for projects settings) have no impact on the built-in business day checks for automation, so you would need to manually test for those dates with repeated conditions, or try some list filtering/incrementing. I recommend searching for other posts trying to do this as I recall reading some indicating this is not straightforward to implement.
Finally, have you thought of this approach: when an issue is created use your expected SLA to set the Due Date field to {{issue.created.plusBusinessDays(yourSLAValue)} and then use another rule with a scheduled trigger and JQL to detect issues where the Due Date has lapsed past now?
Kind regards,
Bill
Hey @Bill Sheboy,
thanks for taking the time on reading/answering my post.
On regards your points:
1. I've asked IT admin to check the config related to workdays and working hours. Will come back once having feedback. Question: Is this what you called " built-in business day checks for automation" something implicit on global config I can use on my calculations? (e.g. when calling "BusinessDays" function it checks the general calendar config to know what is business days).
2. Yes, the 1440 is because when comparing 2 dates (datetime format) using business day, if the full day is not yet completed, the result of the calculation is 0 which leads me to error on the further formulas. By using the 1440 I define that the condition is met within 1 business day (in mins to keep consistency with other KPIs).
3. About your proposal, yes, I've tried out a similar approach. But how to set SLAs based on minutes or hours instead of days... Im not sure if it covers the various scenarios Im dealing with. Examples (working days: Mon / Fri from 9am to 6pm):
If Im able to get an accurate result out of this, I can easily compare/manage accordingly as you are suggesting... but so far couldn't make it work.
Regards,
Esteban
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I made it work by using the proposed approach (by setting sth like "{{issue.created.plusBusinessHours(1).minusMinutes(30)}}" for 30 mins within business hours)
Thanks for the feedback @Bill Sheboy !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Replacing my response...
I did not know there was a plusBusinessHours() feature. Well done!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
neither I did... nor even that several logic can be combined in same calculation (like plus and minus).
FYI - I cannot use default SLA functionality as a) I want consistency across multiple projects and units (internal and external), something I get as some projects has been created not as service project but development ones, b) while fetching JIRA data from Confluence via nested macros, some fields are seen but no value on them despite I can see them fulfilled on JIRA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the missing data in the Confluence macros, I recommend working with your site admin to submit a ticket to Atlassian Support as they may not know about that symptom: https://support.atlassian.com/contact/#/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Esteban Borja Lopez I am working on a similar use case, but instead of populating custom field, I am triggering email notifications if the SLA has missed,
Can you explain the formula you have used for 30 min SLA calculation with an example?
{{issue.created.plusBusinessHours(1).minusMinutes(30)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Esteban Borja Lopez @Bill Sheboy
Hope you both are doing well!
I am working on similar use cases:
If you could provide smartvalue and conditions you used to implement above three cases, it will be relay helpful for me.
I am strangling a lot since last week but finding it very difficult to implement this automation rule, Fortunately I came across this discussion today and seeking for your help now.
Thank you for your time and consideration, looking forward for your response on this query,
Thank you,
Dvipa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As this is a very old thread, I recommend creating a new question, and perhaps linking back to this one. That will ensure the maximum number of people see your question to offer ideas.
When you create your question, please include specifics for:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.