Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,306
Community Members
 
Community Events
176
Community Groups

Automation rules using office hours

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?

1 answer

0 votes
Mark Segall Community Leader Jan 06, 2023

Hi @Michael Nassette - You could do something like this:

  • TRIGGER: Scheduled (Advanced Cron Expression)
    • 0 0,30 9-17 ? * * *
    • Priority = Critical AND "Time to resolution" != breached() AND "Time to resolution" < remaining(30m)
  • ACTION: Send Slack Message

 

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:

  • TRIGGER: Issue Created
  • CONDITION: Priority = Critical
  • ACTION: Send Slack Message

 

 

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.

Mark Segall Community Leader Jan 06, 2023

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.

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.

Mark Segall Community Leader Jan 09, 2023

Apologies, I understand now that you're trying to trigger based upon SLA. 

  • TRIGGER: SLA Threshold Breached
    • Select your desired SLA
    • Select Will Breach in the next 30 mins
  • CONDITION: Priority = Critical
  • ACTION: Send Slack Message

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.

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.

Ahh Got it... How about this:

  • TRIGGER: SLA Threshold Breached
    • Select your desired SLA
    • Select Will Breach in the next 30 mins
  • CONDITION: Priority = Critical
  • IF CONDITION (Advanced - All conditions match):
    • {{now.format("h")}}
      Greater Than
      8
    • {{now.format("h")}}
      Less Than
      18
    • ACTION: Send Slack Message (your slack channel for during office hours)
  • ELSE
    • ACTION (Send Slack Message (your slack channel for outside of office hours)

Got it to work with this:
Schermafbeelding 2023-01-09 195203.png

Mark Segall Community Leader Jan 09, 2023

Sorry - DIdn't close my brackets in my last reply.  Glad you got this working though.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events