How to create an automation that only comments during weekdays and exclude weekends using JQL?

Reb Bravo February 18, 2024

Hi, I am trying to create an automation that sends 3-strike rule follow-ups to the customer. The automation should only count during weekdays from the last update (Mon-Fri). Also, we are using cron to run the automation : 

0 * * ? * MON-FRI

1st.png

JQL : project = "PSS" AND status = "In Progress" AND (labels is EMPTY OR NOT (labels = "reset_3strike" OR labels = "hold_3strike")) AND not status changed after -3d

The first automation try excluded the weekend but did not apply the 1st strike comment and only added the 2nd and 3rd strike on the same date and time which should be applied on separate days do you also know how we can avoid this kind of scenario?

2nd.png

1 answer

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2024

Hi @Reb Bravo , have a look at examples-of-using-smart-values-with-dates >> Calculating-business-days . I think this would be the way to go.

Reb Bravo February 20, 2024

Thank you for your answer @Jack Brickey . I am currently working on a CRON automation, is it possible for the JQL to skip the weekends? I experienced that the CRON works but the 1st strike that should appear does not run because it was on the weekend then the automation proceeded with the 2nd and 3rd strikes.

Also on the link you sent is this for JQL ?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

Hi @Reb Bravo ,

you can write the cron yourself but it isn't necessary I think as the Automation presents an easier solution. Before I illustrate this, let me restate what I think you ar trying to do here.

  • you want to remind the customer daily to take action (such as comment back)
  • you give the customer 3 chances to respond and if they do not then take action (such as close issue)
  • you want this process to only occur on business days (M-F)

example 1: 3-strike process starts on Tuesday then

  • tuesday - hey customer please respond 
  • Wednesday - no response (strike 1), hey customer please respond
  • thursday - no response (strike 2), hey last chance are you there?
  • friday - no response (strike 3), closing issue

example 2: 3-strike process starts on Wednesday then

  • Wednesday - hey customer please respond 
  • Thursday - no response (strike 1), hey customer please respond
  • Friday - no response (strike 2), hey last chance are you there?
  • Monday - no response (strike 3), closing issue

assuming I have it right maybe simply schedule as follows...

IMG_3715.jpeg

please note that I have not provided a solution for keeping count of strikes here. I assume that you are using a custom field for this or some other method.

 

Like # people like this
Reb Bravo February 20, 2024

Thank you Jack for the great effort! this is really good and I would try this automation. Another question so If I make a JQL like this one : JQL : project = "PSS" AND status = "In Progress" AND (labels is EMPTY OR NOT (labels = "reset_3strike" OR labels = "hold_3strike")) AND not status changed after -7d

Here is an example of the 1st 2nd and 3rd strike : 

1st strike : 

1st strike.png

2nd strike :

2nd strike.png

3rd: strike:

3rds strike.png

This will not be affected by the scheduled run for the automation right? It means this will still be applied to all the tickets that were not updated past x days. Also, the follow up we want is 7 days for 1st strike 14 days for 2nd strike and 21 days for the 3rd strike so I am assuming that the comments will not display at the same time if my thoughts are right.

KUDOS to you buddy for helping me out here.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 21, 2024

Why not create a single rule and add a label each time (strike1, strike2, strike3) and the last one closes the issue assuming that is the final action. Just use if/else block to check labels...

if labels is empty or labels != strike1

    Then add label strike1

else if labels != strike2

    Then add strike2

else if labels != strike3

    Then add strike3 and close issue 

 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer