Gorgias logo
Gorgias logo

All collections

Automate your work with Rules

Rules allow you to perform actions on tickets when something happens in Gorgias. If you want to automate repetitive tasks, such as tagging tickets or responding to common questions, you're in the right place!


How it works

To get started, here's a helpful video tutorial breaking down the most common components of each Gorgias rule.


Common variables in rules

We know that it can be difficult to start using rules, especially if you don't know how to find some common variables like whether a ticket is opened or closed, how many orders has a customer made, and if an intent has been detected on a message.

To make it easier, we've put together a small diagram, showing where to find the most common variables so you can start automating tickets quicker and more effectively.


Rule conditions

Some information regarding rule conditions:

1) The "Contains one of" condition is handling the keywords you entered as if there is an "OR" between them. To trigger the rule, at least one keyword needs to be present.

2) The "Contains all of" condition is handling the keywords you entered as if there is an "AND" between them. To trigger the rule, all of the keywords need to be present.


When using keywords in your rules, we suggest setting one keyword at a time ("new", "order", "only"). If you enter an entire phrase (e.g. "new order only"), then the order of the words needs to be the same for the rule to trigger (this means that "only new order" would not trigger the rule).
Please note:

- 'Does not contain one of' rule filter label has been renamed 'Does not contain all of' triggering only if any of the listed elements is missing.

- The 'Reply to ticket rule' action was renamed 'Reply to customer' and now only triggers as a response to the customer’s message (as opposed to an agent’s message). Note that you can still use the 'Apply macro' or 'Send email' actions to reproduce the initial behavior


Actions to remove 

A new action which we have recently added is the ability to remove tags using rules as per the instructions below:

This way you can remove tags without having to reset them.


Date formats in rules 

It is very simple to trigger a rule according to a particular date using the following date format: weeks (w), days (d), hours (h), minutes (m) and seconds (s). 

This applies to the following date conditions in your rules:


Ticket:

  • Closed datetime 
  • Created datetime 
  • Last message datetime 
  • Last received message datetime 
  • Opened datetime 
  • Updated datetime


Message:

  • Created datetime


Example: Ticket closed datetime is less than or equal to 3d 2h 20m.


Now let's help you set up your first rule! Below you'll find examples of some of the most common setups.


Managed rules

Managed rules need no code, no setup. Install it from the rule library and you are good to go. These rules will be marked in the rule library by the ✨ Managed Rule badge.

  • In order to install them, select the rule, click on install and the process is done.
  • You’ll be directed to the rule edition page, and the first thing you should notice is the absence of a code interface.

For example, managed rule 'Non-support related email' will take care of all of the tickets created by non-support related email, closing them and tagging them so that they are sorted in the appropriate view.

Please bear in mind that, this feature is only available to Automation Add-on subscribers only. For more information about how you can use the add-on to automate 5% of your customer requests, don’t hesitate to reach out!



Managed rule metrics

You can now see the impact of your managed rules straight away by checking out the 'Target up to X tickets/month' metric on the right-hand side of your managed rule setup page. This metric will tell you how many tickets per month the rule in question has handled. Each time a new ticket triggers one of these rules and would do an action, Gorgias will increment the counter. The counter is based on the last 30 days worth of data.


Setup instructions

Here we will cover some of the most common examples of rules and how to set them up step-by-step.

Shipping status tickets

Say you get a lot of shipping tickets, and you want to classify them using a tag. Let's build a rule for that.

  1. In Settings, go to Rules and click 'Create a new rule'.
  2. Select 'WHEN Ticket created' as a trigger.
  3. Click on THEN, and select an IF statement.
  4. Select Message -> Intents -> Name -> Contains all of -> Shipping/Status.
  5. Click again on the IF button, and select AND.
  6. Choose Message -> From agent -> IS NOT -> True (this means that the ticket is not created by an agent).
  7. Click on the following THEN, select 'Add tag' as an action, and type 'shipping'.
  8. Click 'Save rule' and activate it.



Well done! Now, each time you receive a customer message asking about an update on delivery, that ticket will be automatically tagged! As the next step, you can create a view that only contains shipping tickets.

To learn more about intents, check out this article: Automating your work using customer intents.


You can add OR conditions to look for other words. Just click on the IF blue button to add another condition. 


Tag Negative comments

This example shows a simple rule tagging negative tickets using both the 'negative', 'threatening' and 'offensive' sentiments.

To learn more about sentiments, check out this article: Automating your work using customer sentiments.



Auto-close tickets

If you're getting email notifications from a specific email address that you want to close, you can create a rule to close them automatically.

  1. In Settings, go to Rules and click 'Create new rule'.
  2. Select 'WHEN Ticket created' as a trigger.
  3. Click on THEN, and select an IF statement.
  4. Select Ticket -> Customer -> Email -> Contains one of -> and type the email addresses that sends the email notifications you want to close. 
  5. Click on THEN, and select an Action.
  6. Select Set statusClosed.
  7. Click 'Save' and activate it.

Now, all emails that have this subject will be automatically closed. 


Keywords in rules are not case-sensitive anymore. If the Caps-lock option is turned on by mistake, letters will get minimized automatically.


Auto-reply - Where is my order?

Say you get a lot of shipping tickets, and you want to auto-reply. Let's build a rule for that.

  1. In Settings, go to Rules and click 'Create new rule'.
  2. Select 'WHEN Ticket created' as a trigger.
  3. Click on THEN, and select an IF statement.
  4. Select Message -> Intents -> Name -> Contains all of -> Shipping/Status.
  5. Click again on IF button, and select AND.
  6. Choose Message -> From agent -> IS -> False (this means that the ticket is not created by an agent).
  7. Click on the following THEN -> choose 'Reply to customer' as an action -> type your message.
  8. Click 'Save' and activate it.


Auto-reply - Outside business hours


If you want to create an automated response to be sent after business hours you can use the example below for that. 

  1. In Settings, go to Rules and click 'Create new rule'.
  2. Select 'WHEN Ticket created' as a trigger.
  3. Click on THEN, and select an IF statement.
  4. Select Ticket -> Created date of ticket -> OUTSIDE BUSINESS HOURS.
  5. Click on the following THEN -> choose 'Reply to customer' as an action -> type your message.
  6. Click 'Save' and activate it.


If you would like to create a rule with a delayed action, to reply to a customer for example, you can see how to set this up in the Rules - Main Use Cases article.


For more tutorials on how to set up some of the most common rules feel free to check out our guide here, our video tutorials here, and our 'Working with Rules' course here.


Was this article helpful?
Yes
No