> For the complete documentation index, see [llms.txt](https://help.glpi-project.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.glpi-project.org/glpi-12/administration/rules/business-rules-for-tickets.md).

# Business rules for tickets

## Business Rules for Tickets

A mechanism is available to automatically modify ticket attributes when it is opened or updated.

The available criteria include all ticket attributes (title, description, status, category, urgency, impact, priority, request source, asset type, requester group/user/location, assigned to supplier/group/technician, asset type, entity) as well as others related to email collectors (headers...).

The possible actions are modifying certain ticket attributes (status, category, urgency, impact, priority, requester group/user/location, assigned to supplier/group/technician). It is also possible to assign a ticket to an equipment based on the data present in the ticket (assignment based on IP address, full name and domain, MAC address) or even to send a validation request.

{% hint style="info" %}
Note that only modified fields are passed to the rules engine. For tickets, the following fields are always passed in addition to those that have been modified:

* **`entities_id`**
* **`global_validation`**
* **`priority`**
* **`List of actors`** (requester, observer, assigned to)
  {% endhint %}

When using GLPI in multi-entity mode, business rules for tickets can be recursive, meaning they can be defined on an entity with an application to the entity itself and its sub-entities.

Three tabs are available:

* **applied rules (entity name)**: all rules from parent entities played (only if you have the *Business Rules (parent)* permission on the *Business Rules for Tickets (entity)* permission);
* **local rules**: the list of rules defined for the current entity;
* **rules applicable in sub-entities**: all rules applied after those of the current entity.

{% hint style="warning" %}
Special case for Urgency and Impact fields

If you define an urgency and/or impact via a business rule, you should also consider adding the *Recalculate priority* action so that it is based on the fields you have just defined.
{% endhint %}

***

### **Available Criteria (Ticket Specific)**

| Name                    | Description                                                                            | Key                          | Operator                                                                                                                                                                                                  |
| ----------------------- | -------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ticket Type             | incident or request                                                                    | `type`                       | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail Collector          | Mail collector                                                                         | `_mailgate`                  | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail X-Priority Header  | Mail X-Priority header                                                                 | `_x-priority`                | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail From Header        | Mail From header                                                                       | `_from`                      | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail Subject Header     | Mail Subject header                                                                    | `_subject`                   | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail Reply-To Header    | Mail reply-to header                                                                   | `_reply-to`                  | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail In-Reply-To Header | Mail in-reply-to header                                                                | `_in-reply-to`               | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Mail To Header          | Mail To header                                                                         | `_to`                        | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| SLAs TTR                | SLA TTR identifier                                                                     | `slas_id_ttr`                | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| SLAs TTO                | SLA TTO identifier                                                                     | `slas_id_tto`                | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| OLAs TTR                | OLA TTR identifier                                                                     | `olas_id_ttr`                | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| OLAs TTO                | OLA TTO identifier                                                                     | `olas_id_tto`                | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Requester Location      | Requester location                                                                     | `_locations_id_of_requester` | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`, `is under`, `is not under` |
| Element Location        | Item Location                                                                          | `_locations_id_of_item`      | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`, `is under`, `is not under` |
| Ticket Location         | Ticket Location                                                                        | `locations_id`               | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`, `is under`, `is not under` |
| Location Code           | Location Code (of ticket)                                                              | `_locations_code`            | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Validation              | Validation Status                                                                      | `global_validation`          | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |
| Validation Step         | Name (id) of the validation step - is defined if a validation is accepted or rejected. | `_validationsteps_id`        | `is`, `is not`, `contains`, `does not contain`, `starting with`, `finished by`, `regular expresison matches`, `regular expression does not match`, `exists`, `does not exist`                             |

### **Available Actions (specific to tickets)**

| Name                   | Description                                                                                                                    | Key                        | Actions                                      |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | -------------------------------------------- |
| Ticket Type            | Change the ticket type (incident, request)                                                                                     | `type`                     | `Assign`                                     |
| Project                | Link the ticket to an existing project                                                                                         | `assign_project`           | `Assign`, `Add`, `Assign regex result`       |
| SLAs TTR               | Link to a Time To Respond SLA                                                                                                  | `slas_id_ttr`              | `Assign`                                     |
| SLAs TTO               | Link to a Time To Own SLA                                                                                                      | `slas_id_tto`              | `Assign`                                     |
| OLAs TTR               | Link to a Time To Respond OLA                                                                                                  | `olas_id_ttr`              | `Assign`                                     |
| OLAs TTO               | Link to a Time To Own SLA                                                                                                      | `olas_id_tto`              | `Assign`                                     |
| TTR                    | Set the ticket's *time\_to\_resolve* value to null. Only works if this value is manually assigned, without an SLA association. | `time_to_resolve`          | `Delete`                                     |
| TTO                    | Set the ticket's *time\_to\_own* value to null.                                                                                | `time_to_own`              | `Delete`                                     |
| Internal TTR           | Set the ticket's *internal\_time\_to\_resolve* value to null.                                                                  | `internal_time_to_resolve` | `Delete`                                     |
| Internal Response Time | Set the ticket's time\_to\_resolve value to null.                                                                              | `internal_time_to_own`     | `Delete`                                     |
| Location               | Set the location associated with the ticket                                                                                    | `locations_id`             | `Assign`, `Copy from user`, `Copy from item` |
| Contract               | Associate a contract                                                                                                           | `assign_contract`          | `Assign`, `Assign regex result`              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.glpi-project.org/glpi-12/administration/rules/business-rules-for-tickets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
