Lesson 4: Business rules

<div class="container">
<div class="row">
<div class="col-md-3">
<ul class="nav nav-underline flex-column">
<li><a class="nav-link" href="https://support.zendesk.com/hc/en-us/articles/4408884056346">Introduction: Getting started with Zendesk Support</a></li>
<li><a class="nav-link" href="https://support.zendesk.com/hc/en-us/articles/4408881925786">Lesson 1: Ticket Basics</a></li>
<li><a class="nav-link" href="https://support.zendesk.com/hc/en-us/articles/4408883609370">Lesson 2: Viewing and Organizing</a></li>
<li><a class="nav-link" href="https://support.zendesk.com/hc/en-us/articles/4408882997530">Lesson 3: Solving Tickets</a></li>
<li><a class="nav-link disabled" href="https://support.zendesk.com/hc/en-us/articles/4408885959066">Lesson 4: Business Rules</a></li>
<li><a class="nav-link" href="https://support.zendesk.com/hc/en-us/articles/4408883043226">Where to go next</a></li>
</ul>
</div>
<!-- .col-md-3 -->
<div class="col-md-9">
<p>Topics covered in this lesson:</p>
<div class="list-group">
<a class="list-group-item list-group-item-action" href="#triggers-automations">Triggers and automations</a> <a class="list-group-item list-group-item-action" href="#conditions-actions">The building blocks: conditions and actions</a> <a class="list-group-item list-group-item-action" href="#standard-notif-triggers">Standard Zendesk Support notification triggers</a> <a class="list-group-item list-group-item-action" href="#automations">Automations</a>
</div>
<h2 id="triggers-automations">Triggers and automations</h2>
<p>We've now arrived at the area of Zendesk that many people find a little harder to understand—at least initially. This lesson describes automated business rules. This means predefined actions that are automatically applied to tickets. There are two types of automated business rules: <em>automations</em> and <em>triggers</em>.</p>
<p>Let's start with what's common to both before we explain how they are different. Automations and triggers define a set of <em>actions</em> that will occur when a ticket matches specific <em>conditions</em>. For example, if a ticket is created by an end user who belongs to a specific organization (this is the condition), it can be automatically assigned to the agent group that provides support to that organization (this is the action).</p>
<p>To make this even simpler to understand, it boils down to this easy formula: if <em>x</em> is true, then do <em>y</em>.</p>
<p>So what's the difference between automations and triggers? Each contains a set of conditions and a set of actions. Each modifies a ticket's data. Each affects tickets when specific events occur. The difference is the kind of events that cause the ticket to be modified. Automations act on tickets based on an event in time (for example, four hours after a ticket update). Triggers act on a ticket when a ticket is created or updated (the create and update events). If a ticket doesn't meet the conditions contained in your automations or triggers nothing will happen.</p>
<p>The purpose of creating automated business rules is so that your agents no longer need to do these types of repetitive tasks manually. In the next few sections of this lesson, we'll dig a little deeper into both automations and triggers.</p>
<h3 id="h_01HS2A5X23SGPDEF1Q1VHEVE2D">Who can create automations and triggers?</h3>
<p>Only admins can create and manage automations and triggers. This is because these business rules might affect every ticket, and it's the responsibility of an admin to define your custom automations and triggers as part of the overall support workflow they set up.</p>
<h2 id="conditions-actions">The building blocks: conditions and actions</h2>
<p>Automations and triggers consist of sets of conditions and actions. If a ticket meets the conditions then the actions are applied. Let's take a closer look at conditions to get started.</p>
<p>Conditions are references to ticket and user fields and the data contained in those fields.</p>
<p>There are two types of conditions – <em>all</em> conditions and <em>any</em> conditions. The <em>all</em> conditions, as you've probably already figured out, must all be true. If any of the condition statements fail (are not true), the automation or trigger will not act on the ticket.</p>
<p><img class="img-screenshot" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/support_intro_action3.png" alt=""></p>
<p>Additionally at least one of the <em>any</em> conditions must also be true. For example, you might want an automation or trigger to act only on tickets that are submitted from a list of specific email addresses, as in this example:</p>
<p><img class="img-screenshot" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/support_intro_action2.png" alt=""></p>
<p>If either of these conditions is true, the automation or trigger will act on the ticket. If you use only one condition in the <em>any</em> section, it will behave like an <em>all</em> condition and therefore must be true for the automation or trigger to act on the ticket.</p>
<p>Action statements follow the same format, but rather than testing for conditions to be true or not, actions set ticket properties and send email notifications, as in this example:</p>
<p><img class="img-screenshot" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/support_intro_action1.png" alt=""></p>
<p>Conditions, unlike actions, contain operators that you can use to build condition statements. For example, using the Is not operator allows you to single out a value to exclude from a condition, just as we did in this example (Ticket: Status is not Solved). You'll also use other operators, such as Less than, Greater than, Changed to, and Changed from.</p>
<h2 id="standard-notif-triggers">Standard notification ticket triggers</h2>
<p>Zendesk comes with a number of helpful triggers that are used to notify ticket requesters, agents, and groups when certain events occur. They are all activated by default and are ready to take action on any tickets that meet the conditions.</p>
<p>You can review these triggers on the Triggers page admin page (in <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408838272410" target="_blank" rel="noopener">Admin Center</a><span> &gt; Objects and rules &gt; Business rules &gt; Triggers</span>).</p>
<p>Let's look at the Notify requester of received request trigger. This trigger sends an email message to the ticket requester when a new ticket is received. Here are the conditions:</p>
<p><img class="img-screenshot" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/support_intro_trigger1.png" alt=""></p>
<p>The Ticket &gt; Is condition is used to capture the two trigger events that we discussed earlier: <em>created</em> and <em>updated</em>. If you only want a trigger to act on new tickets, you select Created. This is the choice we want for this trigger because we only want the ticket requester to receive the new ticket confirmation email once, when the ticket is created. There are other triggers for notifying the requester when an agent has added a comment and when the ticket has been solved. Each of those triggers uses Ticket &gt; Is &gt; Updated.</p>
<p>The second condition, Status &gt; is not &gt; Solved, is used because we only want the trigger to apply to active tickets—not our solved tickets.</p>
<p>Now let's look at the actions contained in this trigger and what will happen when the trigger is applied to a ticket.</p>
<p>The purpose of this trigger is to notify the requester that their support request was received and a ticket was created. To do that, we create an email notification using the combination of actions shown here:</p>
<p><img class="img-screenshot" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/support_intro_trigger2.png" alt=""></p>
<p>Take a quick look at each of the notification triggers and you can see how they all work.</p>
<p>This video will give you a quick introduction to how triggers work:</p>
<p><iframe src="//fast.wistia.com/embed/iframe/kgjhe6bqfa" width="560" height="315" frameborder="0" allowfullscreen=""></iframe></p>
<p>Automating notifications with triggers (2:02)</p>
<h2 id="h_01HS2A5X23Y2EDE3JCNGY9NT5J">Using placeholders in automations and triggers</h2>
<p>Just like macros, you use placeholders in automations and triggers to dynamically insert user and ticket-specific data into ticket replies and the email notifications that are sent to the ticket requester.</p>
<p class="d-inline-flex gap-1"><button class="btn btn-dark" type="button" data-bs-toggle="collapse" data-bs-target="#buildTrigger" aria-expanded="false" aria-controls="buildTrigger"> Try it yourself: Build an escalation trigger </button></p>
<div id="buildTrigger" class="collapse">
<div class="card card-body">
<h3 id="h_01HS1NKSSTV5XA70TK1ZZSY7T7">Build an escalation trigger</h3>
<p>To exercise a little bit of what you've just learned, let's create a simple but very useful trigger. This trigger will escalate all tickets from VIP customers. If you recall from a previous lesson, you can add tags to user and organization profiles and those tags are automatically added to every ticket from those users or users within those organizations. In this example, we'll use a tag to identify the incoming tickets that need to be escalated.</p>
<p>If you'd like to try creating an escalation trigger, follow these steps:</p>
<ol>
<li class="li">
<span>In</span><a href="https://support.zendesk.com/hc/en-us/articles/4408838272410" target="_blank" rel="noopener"><span> </span>Admin Center</a><span>, click the </span><strong>Objects and rules</strong><span> icon (</span><img id="topic_zkg_rxf_sv__image_x1z_qbf_gz" class="image" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/ac_objects_rules_icon.png"><span>) in the sidebar, then select </span><span><strong>Business rules &gt; Triggers.</strong></span>
</li>
<li>Click <strong>Add Trigger</strong>.</li>
<li>Enter the title <em>Escalate VIP tickets</em>.</li>
<li>Add the <strong>Status</strong> condition and then select <strong>Less than</strong> as the condition operator and then <strong>Solved</strong>.</li>
<li>Click <strong>Add condition</strong> and then select <strong>Tags</strong>. The condition operator is <strong>Contains at least one of the following</strong>, which is what we want. Now, enter <em>vip</em> as the tag.</li>
<li>Now we need to add the actions. When a ticket contains the <em>vip</em> tag, we want it to be assigned to the Advanced support group that we created in a previous lesson. In the actions section, select <strong>Group</strong> then select <strong>Advanced support</strong>.</li>
<li>We also want to set the ticket's priority to <strong>Urgent</strong>. Add a new action by clicking the + button and selecting <strong>Priority,</strong> then selecting <strong>Urgent</strong>.</li>
<li>Save the trigger by clicking <strong>Create</strong>.</li>
</ol>
<p>Whenever a ticket contains the <em>vip</em> tag, this trigger will act on it.</p>
</div>
</div>
<h2 id="automations">Automations</h2>
<p>As you learned in a previous section, both automations and triggers are built with conditions and actions. However, since automations are based on events in time, they contain additional conditions that allow you to make ticket updates a certain number of hours after certain events occur. For example, you can create an automation that sets a ticket's priority to Urgent after some number of hours have passed since it was created.</p>
<p>That's one example of how an automation might be used. In Zendesk, tickets are closed by automation, not manually. This is one of the standard automations. It's called Close ticket 4 days after status is set to solved. You can review it in the Automations admin page (in <a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408838272410" target="_blank" rel="noopener">Admin Center</a> &gt; Objects and rules &gt; Business rules &gt; Automations). We've found that closing tickets four days after they have been solved is a best practice; however, you can of course change this automation and set it to as many days as you'd like, up to 28 days. After that, Zendesk will automatically close the ticket.</p>
<p>Time-based conditions provide you with the flexibility to craft automations based on specific events in the ticket lifecycle. Here are the common uses of automations:</p>
<ul>
<li>Notifying agents when an assigned ticket remains unresolved for <em>x</em> number of hours</li>
<li>Notifying agent groups when a new ticket remains unassigned for <em>x</em> number of hours</li>
<li>Increasing a ticket's priority if a certain amount of time has passed without the ticket being touched</li>
<li>Notifying the assigned agent after <em>x</em> number of hours when a pending ticket has been updated by the requester</li>
<li>Closing tickets <em>x</em> number of days after they have been set to solved</li>
</ul>
<h3 id="h_01HS2A5X239WZTG21EDZB86HAB">A safe place for testing your business rules</h3>
<p>As we mentioned earlier, only admins can create automations and triggers because these business rules potentially affect all of tickets. On Enterprise plans, you can also create a test version of your account, referred to as a <em>sandbox</em>, that you can use to test and fine-tune, new automations, triggers, or anything else without actually making changes to your actual tickets.</p>
<p class="d-inline-flex gap-1"><button class="btn btn-dark" type="button" data-bs-toggle="collapse" data-bs-target="#buildAutomation" aria-expanded="false" aria-controls="buildAutomation"> Try it yourself: Build an escalation automation </button></p>
<div id="buildAutomation" class="collapse">
<div class="card card-body">
<h3 id="h_01K5YA5DCZ1324RTWR7PX4JX19">Build an escalation automation</h3>
<p>As a companion to our escalation trigger, let's build an automation that alerts the assigned group and agent that the VIP ticket hasn't been handled in the amount of time we've promised.</p>
<p>This automation will escalate all VIP tickets that have not been responded to within 1 day. In this case, escalation means raising the priority from High to Urgent. We'll also send an email notification to the agent to make sure that they're aware of the Urgent status.</p>
<p>Watch this video to see how an escalation automation is created:</p>
<div class="bodydiv training_videos_embedded">
<div class="bodydiv video_fw2zpnar1h">
<div class="bodydiv training_videos_caption">Building an Automation (1:34)</div>
</div>
</div>
<p>If you'd like to try creating an escalation automation, follow these steps:</p>
<ol>
<li>
<span>In</span><a href="https://support.zendesk.com/hc/en-us/articles/4408838272410" target="_blank" rel="noopener"><span> </span>Admin Center</a><span>, click the </span><strong>Objects and rules</strong><span> icon (</span><img id="topic_zkg_rxf_sv__image_x1z_qbf_gz" class="image" src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/ac_objects_rules_icon.png"><span>) in the sidebar, then select </span><span><strong>Business rules &gt; Automations.</strong></span>
</li>
<li>Click <strong>Add Automation</strong>.</li>
<li>Enter the title <em>Escalate unsolved VIP tickets to Urgent</em>.</li>
<li>Add the <strong>Ticket: Status</strong> condition and then select <strong>Less than</strong> as the operator and then <strong>Solved</strong>.</li>
<li>Add another condition by clicking the + button and then select <strong>Ticket: Hours since created</strong> and then <strong>(calendar) Is</strong> as the operator and <strong>24</strong> for the number of hours that have passed since the ticket was created.</li>
<li>Add another condition by clicking the + button and then selecting <strong>Tickets: Tags</strong>. The condition operator is <strong>Contains at least one of the following</strong> and the tag is <em>vip</em>.</li>
<li>Finally, we add the actions. The way we have our VIP trigger from a previous section of this lesson set up is that when a ticket is received from a VIP customer, the tag is detected and the ticket's priority is set to <strong>High</strong>. To escalate this ticket, we now want to set the ticket's priority to <strong>Urgent</strong>. Add the action <strong>Ticket: Priority = Urgent</strong>.</li>
<li>Our last action is to email the assigned agent. We do this by adding <strong>Notifications: Email user = (assignee)</strong>. We then enter a subject and a description for the email notification.</li>
<li>Save the automation by clicking <strong>Create automation</strong>.</li>
</ol>
</div>
</div>
</div>
<!-- .col-md-9 -->
</div>
<!-- .row -->
</div>
<!-- .container -->
<p>
<script>
let link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css';
link.integrity = 'sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH';
link.crossOrigin = 'anonymous';
document.head.appendChild(link);

const style = document.createElement('style');
style.innerHTML = `
.col-md-3 {
padding-left: 0px;
}
.col-md-9 {
padding: 0px;
}
.nav-underline {
--bs-nav-underline-gap: 2px;
}
.list-group {
margin-bottom: 1.75rem;
}
.btn {
margin-bottom: 1rem;
--bs-btn-font-size: 1.25rem;
}
.collapse {
margin-bottom: 2rem;
}
.article-body .nav {
list-style-type: none;
padding-left: 0px;
}
.article-body .nav-link {
text-decoration: none;
}
`;
document.head.appendChild(style);
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</p>