###What are Triggers?
Triggers are business rules you define to take action based on certain conditions on a ticket. Triggers will take action immediately after tickets are created, updated or deleted. For example, a trigger can be used to notify all agents except the current assignee when a ticket has been assigned. Another can be created to then notify the customer when a ticket is solved.
###How do Triggers work?
Triggers are created by combining events, conditions, operators and actions. Triggers create if/then statements: If this happens, then do that. For example, if the ticket queue changes to 'Tier 2', un-assign the ticket and send an email to notify James, Rob and Charles.
You select an 'event' for the trigger which tells the trigger when to run. The trigger can run when a ticket is created, updated or deleted.
When creating a trigger the business rules you define can be based on 'all' conditions being true or 'any' condition being true. A condition is the 'if' part of the if/then statement. For example, Jennifer the Boss needs to be notified by email if tickets assigned to Mark are placed 'on hold'. But, she only needs to be notified when they are in certain queues.
The trigger would be set up to meet ALL of these conditions: ticket assignee is Mark, ticket status is 'on hold' and then ANY of these conditions: ticket queue is Exchanges, Returns, Stock Rotation. In other words, the ticket can be in any of those queues but it has to meet the two other conditions for the trigger to execute.
An operator allows you to define the condition specifically. For example, the operator will dictate the condition as a filter by looking to see if something is present or not present, to include or exclude, to contain or not contain, etc.
'Actions' is what happens when the Trigger executes. The 'action' could be sending an email or setting ticket properties.
###How does Mojo know when to use Triggers?
Every time a ticket is created, updated or deleted the ticket is checked against the triggers to see if the ticket meets any of the conditions of any of the triggers. If the conditions are met, the trigger is executed to take action on the ticket.
### How do I avoid creating Trigger loops?
Once a trigger makes a change to a ticket the ticket is run through the rest of the triggers to check again. One trigger will not execute on a ticket twice but a ticket can be affected by several triggers. Be careful when setting up triggers that you do not create trigger loops which would cause two triggers to counteract each other.