Nullifying conditions for your triggers


A nullifying condition stops automations and triggers from forming a loop (Zendesk have written about this for automations here). But what's a loop? you may ask. Here's an example. You might create a trigger to email Joe in accounts when the following conditions are met under "Meet all of the following conditions":  




The problem with this logic is that this trigger won't just email Joe once. He's now going to get an email every single time the ticket is updated when those conditions match - which, if the form never changes, will be every update for the rest of the tickets life. Not good.

This is particularly important to understand when using our Tasks app, and you're setting up triggers to automatically add a task list to a ticket. The consequence could be that your task list gets added over and over again each time the ticket is updated. Since the app updates the ticket via the api, in a very short amount of time, your task list could have 1000 items in it. 


So how do we stop a trigger from continuing to fire? We add a nullifying condition. 

In Bob's scenario, if we only want to email him once, then you can alter your trigger to check for a tag that doesn't exist on the ticket like this:




The trigger is now checking to make sure the ticket doesn't contain the tag "bob_notified". 

The next step is under "Perform these actions" you create a rule to adds that tag to the ticket like this:




Now that you've set the tag to be added, and the trigger will only fire when the tag doesn't exist on the ticket, the trigger can only fire once - meaning there's no chance of a looping trigger! Woohoo!

Checking and adding tags is probably the simplest way to create nullifying conditions. But nullifying conditions could be anything, as long as the stuff the trigger is doing to the ticket changes it in some way so that next time the ticket is updated the trigger no longer has matching conditions.

For example using the rule under "Meet all of the following conditions":

"Ticket is" - "Created"

This is a nullifying condition in its self. Since a ticket can only be created once, any subsequent update to the ticket will not match the conditions and thus it will not fire any more than once.


Was this article helpful?
6 out of 6 found this helpful



Please sign in to leave a comment.