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

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?

3 answers

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

0 votes
Kateryna_v_SaaSJet_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Feb 17, 2023 • edited Feb 18, 2023

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. 

1_2023-02-17_11-00-59.png
The first will be for Business Hours and a correction message 30 minutes after the trigger. 0_2023-02-17_12-09-05.png

You can also write your custom message for notification using Shortcodes (such as smart values).

2_2023-02-17_12-11-50.png
The second is the same logic configuration, but with a calendar for non-working hours and going to SLACK a minute after the trigger.3_2023-02-17_13-02-50.png4_2023-02-17_12-12-55.png

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.

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 09, 2023 • edited

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

Like Stefan Wolske likes this
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
AUG Leaders

Atlassian Community Events