Using "Hours since...is" and "Hours since...greater than" in automations Follow

team professional enterprise plans

Automations enable you to set up time-based actions to modify tickets or send email notifications.

One popular use of automations is to perform an action a certain amount of time after the ticket is created or changed. You can do this using the "Hours since...is" or "Hours since...greater than" condition.

Note: You can also use "Hours since...is less than" but this article focuses on using "Is" and "Greater than."

To see an example of this, take a look at one of the default automations in Zendesk Support: Pending notification 5 days. You want the action, sending a notification to the user, to occur when the condition is met, five days after a ticket is set to pending.

This same automation could be rewritten to use the "greater than" operator.

Note: If you have business hours enabled, you can set the automation to count business hours or calendar hours. To enable business hours on Professional and Enterprise, see Setting your business hours.

This article covers the following topics:

About using "Hours since...is"

When you use "Hours since....is" in an automation, the automation fires (that is, performs action) a specific number of hours after a ticket is created or changed. For example, you can notify a support manager if a ticket has not been responded to after eight hours after it was created, or whatever your SLA is for first response.

Using "is" gives the automation a one-hour window to be true and fire

When you use the "is" operator, instead of the "greater than" operator, it gives the automation a one-hour window during which conditions can be met and the automation will fire. You can specify whole hours only. You cannot specify partial hours or fractions of hours.

Remember, your automations run every hour and fire if the conditions are met. So when conditions are met, and the specified number of hours has elapsed, the automation will fire. There is an entire one-hour window during which it is considered exactly the specified hour (the hour plus 1-59 minutes), not a one-minute window (when it is exactly that hour and no minutes).

For example, if you want an automation to fire and take action two hours after a ticket is solved, and the ticket has been solved for 2 hours and 39 minutes during the automations run, the system sees that as two hours and fires the automation.

Using "is" does not require a nullifying action (no fear of an endless loop)

When you use the "is" operator you do not need a nullifying action. Remember, automations check every hour to see if their conditions are met. So, you must have either a nullifying action or true-only-once condition in your automation to save it (so that the automation does not fire in an endless loop). The "is" operator can only be true once, so you do not need a nullifying action.

For example, if the hours since the ticket is open is 4 hours (Ticket: Hours since created Is 4), then the condition will only be true once. On the next check, the hours since open will be 5, and the condition will be false.

For more information, seeEnsuring your automation only runs once.

About using "Hours since...greater than"

When you use "Hours since....greater than" in an automation, the automation fires (that is, performs an action) when it is more than a specified number of hours since a ticket is created or changed. For example, you can remind a customer to respond to a pending ticket when more than 48 hours have passed since the ticket was set to pending.

Using "greater than" gives the automation a bigger window to be true and fire

When you use the "greater than" operator, it gives the automation a larger window—more than one hour—during which conditions can be met and the automation will fire.

Remember, your automations run every hour and fire if the conditions are met. So when conditions are met and it has been more than the number of hours you specified, the automation will fire. This does not mean equal to or greater than the specified number, but the specified number plus one (or two or three and so on).

For example, suppose you want an automation to fire and take action when it has been more than two hours since a ticket was solved. The automation will fire when conditions are met and it has been at least three hours since the ticket was solved.

Using "greater than" requires a nullifying action (watch out for endless loops)

When you use the "greater than" operator, you do need a nullifying action because the condition will be true more than once—it will be true every hour after the condition is met for a ticket. So you need a nullifying action to cancel the condition so that it does not fire every hour. With a nullifying action in place, the automation will run (or be checked) every hour, but it will only fire once for tickets that meet the condition.

An easy way to cancel a condition is to add a tag. The automation would check for a tag and, if not present, the automation would add the tag to the ticket and perform the action (sending a notification, for example). If the tag is present on the ticket, the automation will not perform the action again.

For more information, seeEnsuring your automation only runs once.

Understanding when the clock starts

When you specify the number of hours that should be met or exceeded for an automation to fire, when does the clock start counting those hours? The clock does not start exactly when conditions are met for your automation. And the actions are not executed exactly when the number of specified hours is met or exceeded.

Remember that your automations run hourly (at the same time every hour), and not immediately after an event satisfies conditions. The first time an automation runs after conditions are met counts as "zero" hours; so the clock starts during that first automation run after conditions are met (which might be 1-59 minutes later). Then, each subsequent automation run counts as one hour. After the number of specified hours has elapsed or has been exceeded, then the automation fires and executes the action.

Example using "Hours since...is"

For example, let's look at an example using "is." Suppose you have an automation using that performs an action two hours after the ticket is solved. A ticket is solved at 9:15am and your automations run at 10:10.
  • 10:10am automations pass sees that the ticket has been solved and starts the count at zero hours.
  • 11:10am automations run considers it one hour since the ticket was solved.
  • 12:10pm automations run considers it two hours so the automation will fire and perform the action during this automation run.

That does not mean that the automation will fire at exactly 12:10 though. That is when the automation run starts, in this example. The actual time that the automation will fire and take action depends on the number of automations you have and your ticket volume.

So the automation in this example will actually fire at some point during the 12:10 automations run. That will be at least 2 hours and 55 minutes after the ticket was solved.

Example using "Hours since...greater than"

Now let's look at the same example using "greater than" instead of "is." Suppose you have an automation using that performs an action when it's been more than two hours since the ticket was solved. A ticket is solved at 9:15am and your automations run at 10:10.

  • 10:10am automations pass sees that the ticket has been solved and starts the count at zero hours.
  • 11:10am automations run considers it one hour since the ticket was solved.
  • 12:10pm automations run considers it two hours since the ticket was solved.
  • 1:10pm automations run considers it three hours since the ticket was solved, which is greater than two hours. So the automation will fire and perform the action during this automation run.

Again, the actual time that the automation will fire and take action depends on the number of automations you have and your ticket volume.

So the automation in this example will actually fire at some point during the hour, between 1:10 and 2:09. That will be a little as 3 hours and 55 minutes after conditions were met or as much as 4 hours and 54 minutes after conditions were met.

Have more questions? Submit a request

Comments

  • 1

    If you update the status from Pending to Pending, does the clock restart? Or is this based on the initial pending status?

  • 0

    @Camille Wagner,

     

    Did you ever get a response to your question?

  • 1

    So I have not tried this in well over a year but certainly in my experience changing the status from pending to pending does NOT reset the clock. However if you change the status then in another update cycle change it back again then this will work. 

Please sign in to leave a comment.

Powered by Zendesk