# Business rules for tickets

Business rules for tickets are predefined conditions and actions that automate processes, ensuring that tickets are categorized, assigned, and processes efficiently. By defining these rules, teams can reduce manual work, improve response times, and ensure compliance with [service level agreements (SLAs).](/tutorials/helpdesk/service_levels.md)

The rules are accessible from the **`Administration`** > **`Rules`** > **`Business rules for tickets`** menu.

Setting up Business Rules involves 4 main stages:

1. [Creating a new rule.](#create-a-new-rule)
2. [Defining the criteria which will match all or some conditions, according to the logical operator.](#setting-up-the-criteria-for-your-business-rule)
3. [Defining the desired actions once the criteria matches.](#setting-up-actions-for-your-business-rule)
4. Defininig the order of execution of this rule.

![BUSINESS RULES](/files/v2z19tTRRqpOyteqAVKn)

## Rules

A rule is made up of different criteria. Depending on the option chosen (OR / AND) one or all of the criteria must be completed to trigger an action list.

You can refer to general behavior of rules [here](/tutorials/rules/regles_et_dictionnaire.md#Behavior).

## Create a new rule

* **`Administration`** > **`Rules`** > **`Business rules for tickets`** click on **`Add`**,
* Name your rule,
* Choose the **`Logical operator`** according to your needs - if you are not sure which one to use, see more [here](/tutorials/rules/regles_et_dictionnaire.md#Behavior). In this example we are using the Logical operator **`AND`** ,
* In **`Use rule for`** you choose if the rule runs just when a ticket is created, when it is updated or both. In this example we a re using just for **`Add`**,

{% hint style="info" %}
**Reminder**&#x20;

Every rule created start running in tickets opened or updated after the rules creation. So previous tickets will not reveive any actions from new rules created or updated.Give your rule a **`Description`** to make it easier to read without the need of opening criteria and actions,
{% endhint %}

* Add additional **`Comments`** to your rule if you need,
* Set **`Active`** to **`Yes`** if you want the rule to be activated right after its creation,
* Click on **`Add`** at the end of the form.

![CREATE RULE](/files/SGFezl4G4j6qVvr9EW64)

{% hint style="success" %}
**Example**

We are creating a rule to set our SLA and OLA according to this article:

* Every time a ticket is opened from the `Entity` called `Brazil` **AND** the `Category` **is not** `Servers`
* The ticket must assume A **`Time to Own`** of **4 hours in Brazil** and a Time to Resolve of **5 days in Brazil**

These SLAs must be [already created](/tutorials/helpdesk/service_levels.md).
{% endhint %}

{% hint style="info" %}
**Reminder**

This is just ONE example. You may create other rules according to your business.
{% endhint %}

## Setting up the criteria for your business rule

* In your new business rule, click on the tab with the name **`Criteria`**,
* Click on **`Add a new criterion`**,
* Choose a **`Criterion`** that matches one or more needs of your tickets,
* In this case **`Criterion`** > **`Entitiy`** > **`is`** > **`Brazil`**
* Click on **`Add`**,
* Choose the second **`Criterion`** > **`Category`** > **`is not`** > **`Servers`**
* Click on **`Add`**.

{% hint style="info" %}
**Reminder**

Since we have chosen the Logical operator \*\*\`AND\`\*\*, the rule will execute its action only when all the criteria match.
{% endhint %}

![ADD CRITERIA](/files/ah6DykGuwCmDbYteucos)

## Setting up actions for your business rule

* In your new business rule, click on the tab with the name **`Actions`**,
* Click on **`Add a new action`**,
* Chosse an **`Action`** that matches one or more needs of your tickets,
* In this case **`Action`** > **`SLA Time to own`** > **`Assign`** > **`TTO - 4 hours in Brazil`**
* Click on **`Add`**,
* Choose the second **`Action`** > **`SLA Time to resolve`** > **`Assign`** > **`TTR - 5 Days in Brazil`**
* Click on **`Add`**.

![ADD ACTIONS](/files/5RXjt5uqPmTlcThqwnXV)

{% hint style="info" %}
**Reminder**

If for some reason, once a rule matches, the engine needs to stop running the next rules, you must choose the **`Action > Skip remaining rules`** so no other rule after that one in the order will be executed.
{% endhint %}

![SKIP RULES](/files/zt0Oov41cY9Jil299021)

## References

[Documentation GLPI "Rules"](https://glpi-user-documentation.readthedocs.io/fr/latest/modules/administration/rules/rulesmanagement.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.glpi-project.org/tutorials/rules/business_rules_for_tickets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
