I am trying to set up an automation rule that sends a message to a Slack channel when there is 30m left on an SLA timer for critical requests. This rule should only run on Monday-Friday from 09:00-17:00. Outside of these hours, a message to the same Slack channel has to be sent at the moment of creation.
I would assume, the best way to go about this is to set up an advanced compare condition using {now} as a value, and as a 2nd value have a dayofweek/businessday and a time range. The second value seems to be well beyond my understanding and skill level, or maybe I am just overcomplicating this and there is a much more straight forward solution for this.
Anybody have any suggestions?
In case someone wants to follow the solution Michael. Here is it copy and paste ready.
{{now.convertToTimeZone("Europe/Berlin").format("EEE,kk")}}
(Mon|Tue|Wed|Thu|Fri), (0[8-9]|1[0-7])
Thanks
Hello @Michael Nassette
If you are okay with using third-party add-ons, here's another way to do what you need.
Using SLA Time and Report for Jira add-on, you need to create 2 working schedules (calendars) and add them to simple SLA configurations.
The first will be for Business Hours and a correction message 30 minutes after the trigger.
You can also write your custom message for notification using Shortcodes (such as smart values).
The second is the same logic configuration, but with a calendar for non-working hours and going to SLACK a minute after the trigger.
Try using it yourself to understand whether this option will suit you. Here is a link to a 30-day trial. My team develops the app, so if you require further assistance, kindly let me know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Michael Nassette - You could do something like this:
0 0,30 9-17 ? * * *
Priority = Critical AND "Time to resolution" != breached() AND "Time to resolution" < remaining(30m)
Outside of these hours, a message to the same Slack channel has to be sent at the moment of creation.
This would be a separate automation rule:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I understand the cron expression correctly, this would run 2 times per hour, which is not what I am looking for. I want the passing of the time threshold to be treated in real time. The SLA threshold breached trigger would allow for that to happen, but only if I can build a condition that compares the current time (basically the moment the trigger occurs) to a day/time range. If they do not match, the action is to send a Slack message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry I missed the M-F in my original answer. You could change the cron to this:
0 0/5 9-17 ? * MON,TUE,WED,THU,FRI *
This will execute every 5 mins (the most frequent allowed by automation) during that 9-5 window M-F.
One thing to consider with every 5 mins is that if something hasn't been dealt with since the last execution, it will get picked up again and send another message. Up to you as to whether you want a "one and done" message or to continuously nag the team every 5 mins.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This sadly will not cover the need (or want) for this to be real time, with the added potential of spammy behaviour in the Slack channel until there is a status change, or some other automation to kick in.
As there is an SLA threshold breached trigger built into the automations, I really expected there to be a cleaner configuration approach for this.
I have made some progress though, using the Advanced compare condition with the first value being {now.format("E k")} but need to build a regex for the second value to capture the right time window in which I want the automation rule to execute the next steps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies, I understand now that you're trying to trigger based upon SLA.
You should not need anything further regarding business hours if you have set up the SLA calendar appropriately because the SLA threshold will be smart enough to not fire unless the issue falls within the active window.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wish it was that simple :) the SLA however runs 24/7 but the team responsible for the requests does not have enough resources (yet) to have a 24/7 presence. Outside of their current working hours the requests need to be send to a Slack channel from where an on-call setup is in place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh Got it... How about this:
{{now.format("h")}}
Greater Than
8
{{now.format("h")}}
Less Than
18
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.
Sorry - DIdn't close my brackets in my last reply. Glad you got this working though.
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.