Welcome To Our Customer Service Portal


What is a rule location (While rule should be triggered first?)

 

Rules location is there to prioritize the system rule checking in the trigger. Once a trigger starts, such as 'a ticket is created in the inbox', the system checks for rules in the trigger.

When just one rule applies for the ticket, tickets location is irrelevant.
For example: Suppose you have a rule that determines that when a tickets title or body contains "support", it is assigned to "Support" and when a tickets title or body contains  "new" it is assigned to "New". If no tickets contain both "Support" and "New" there's no problem, each is assigned to its respective assignee.  

But sometimes, more than one rule applies. 
The rules are processed in order. Once a rule is successful, the system executes the actions defined in the rule and then continues checking for other rules that might also apply. If another rule applies, it will be executed as well.
For example: Suppose you have a rule that determines that all tickets are assigned to "Support" (you decided not to use any condition) and a rule that determines that when a ticket's title or body contains  "new" it is assigned to "New".  A ticket that contains "new" will be assigned to both "Support" and "New"

When more than one rule applies, the decision which rules to execute is made by 2 variables:  the 'Continue processing rules / Stop processing rules' drop down in the rule itself and the location of the rule in the trigger.
If it weren't for the 'Stop processing rules' option inside the rule, rules location would still have no meaning. BUT, the option does exist…

At the bottom of each rule, there's a drop down with 2 choices: either you choose 'Continue processing rules' or 'Stop processing rules'. Choosing the 'stop' option means that once the current rule applies for the ticket, the system will stop checking if lower located rules apply for the ticket as well (but higher located rules will be counted). Choosing the 'Continue' option means the system will continue checking for lower located rules.



For example: Let's go back to our last example; what will happen with a ticket that contains both "support" and "new"?
The "Support" rule is located first, and the second rule is the "New " rule, as shown below:


 
If we choose the "Continue" option in the 'Support' rule. then the ticket will be assigned to both "Support" and "New" (because we continued the check to the next rule that applies, the "New" rule). If we choose the 'Stop' option, the ticket will only be assigned to "Support"(because we stopped checking after executing the rule).

If it would have been the other way around and the "New" rule would have been first, then the ticket would have been assigned only to "New" – That is why rules numbers within a trigger has a lot of meaning.



The rule location in the trigger needs to be decided by which rules are located before it.

If the rules before it hold no relations to it (so there is no chance that a trigger might trigger it as well), or you don’t mind that those rules will also be executed, then the decision is easy: just number it however you like.

If you want the rule you are creating to be executed alone, with no other rules in the trigger to be executed as well, you need to put it first and then choose the "stop" option in the bottom drop down inside the rule.

Remember, you can always change the location to suit your needs.