Actions based on time ticket was logged

Hi, we have a customer that is only supported between 8am and 5pm. We would like to be able to do special actions when a ticket is logged outside of the defined hours. How would one do this?

Hi @dale

Thanks for the great question!

To perform (or skip) processing based on a time, you will need to render the current time to variables and then test the value of those variables.

For example, if you wanted to execute a step only from Monday through Friday from 8:00 AM until 5:59 PM, you would do the following:

1. Render the current day of the week

This step will render a single digit, 1 through 7, to represent the current day of the week. 1 is Monday. 6 is Saturday. 7 is Sunday.

Note that I specified the correct timezone based on the time I want to render. You can use any timezone from this Wikipedia entry as noted in our docs.

2. Render the current hour of the day

This step wiill render a number, 0 through 23, to represent the current hour of the day. If this runs from 12:00 AM until 12:59 AM, it will render “0”. From 11:00 PM until 11:59 PM, will render “23”.

3. Use an expression to determine if it’s current within business hours

This expression can be used on any action (or on a rule if you stored the results of the previous two steps within global variables). This checks whether the current day is less than or equal to 5, which means it’s Monday through Friday, and if the current hour is greater than or equal to 8 (for 8:00 AM) and less than or equal to 17 (for 5:59 PM).

Take note of the “or equals” parts of the “greater than or equals” and “less than or equals” comparitors, and make sure you consider whether you should use the “or equals” based on the time you are trying to check.

1 Like