--- alias: user-guide-create-event-rule description: "This documentation outlines creating event rules to trigger actions based on system events" --- # Create Event Rule :lock: EventRule.**Create** ## Overview **Event Rules** is an **Administration** entity that allows you to create an **Event Rule** with actions of type Notification or Rule. The created actions will only be executed when the event is triggered. ## Setup No specific setup is required other than to meet the preconditions of the transaction. ## Preconditions * The **Alarm Management** module is properly licensed in the system. * The name of the **Event Rule** must be unique. ## Sequence of Steps ### Step 1: Create Event Rule 1. Enter a unique **Name**. This field can be left empty if there is a **Name Generator** configured to provide unique names automatically. 2. Provide a **Description**. 3. Specify whether the rule is **Enabled** or not (defaults to `True`). 4. Specify a valid **Entity Type** for which the rule applies. 5. Specify a valid **Operation** for the **Entity Type**. !!! note The selected **Operation** and **Entity Type** are what the **Event Rule** will react to. 6. If you want to further specify the conditions when the rule must be executed, use the **Event Filter**, which will already be looking at the table of the selected **Entity Type**, to define additional filters using [JSONata](https://jsonata.org/) expressions (link available on the page). The example below shows an **Event Rule** which is filtering resources that are being terminated, and are of the type `FrontEnd`. Here are some of the Product Characteristic Rule Condition that supports a subset of the JSONata query syntax: * Equal/Not Equal Comparators ('='/'!='). * And/Or Boolean operators ('and'/'or'). * Boolean values for ensuring a expression are always true or false ('true'/'false'). * Quotation marks to define Product Characteristic values (e.g. "Dark Blue" or 'Soft Blue'). * Reference to Product Characteristic without whitespaces (e.g. Color = 'Blue'). * Reference to Product Characteristic with whitespaces or special characters (e.g. \`Wheel color\` = 'Blue') * Parentheses for precedence in compound expressions (e.g. Color = "Blue" and (Size = "Small" or Size = "Medium") ). !!! note The system provides real-time syntax checking and will warn you if there is a syntax error. ![Screenshot showing a UI for creating an event rule, with fields including "Create Event Rule" and a dropdown menu.](images/create_event_rule_01.png) ### Step 2: Actions 1. On the left panel :material-plus: as many **Event Rule** Actions as needed, and for each define the: * **Action Type** - Notification (default) or Rule. * If Rule: * Define an active **Rule** that has an **Event Rule** Scope. * If Notification: * Enter a **Title**. it is possible to add links to objects using the syntax available in the button. For example, the title: **Notification for [Resource {{Name}}]** will create a link to the specific **Resource** that triggered the event (name placeholder will be replaced by the name of the actual resource). * Enter the **Details** using the **Rich Text** editor. !!! note In the **Details** field you can also use the same syntax structure as above. * Select the **Type** of the Notification - values are taken from the `NotificationType` Lookup Table. * Select the **Severity** of the Notification - values are taken from the Lookup Table `NotificationSeverity`. * Select the **Assignment Type**: * **Employee** - for a particular Employee (an active Employee must be defined). * **Everyone** - for every Employee. * **Role** - for a particular Role (an active Role must be defined). * Select whether **Send Email to Assigned Party** is enabled (defaults to `False`). If enabled, the **Send Email to Distribution List** field must specify the distribution list that will receive the email notification. * Define the **Mode** of the clearance: * **Automatic** - the notification will be cleared by the system when the Valid To date/time is reached. * **ManualEveryUser** - every user must clear the notification. * **ManualSingleUser** - the first user will clear the notification for everyone. * In **Valid To** define the date up to which the clearance is valid. This field is mandatory for **Manual Every User** and **Automatic**, but optional for **Manual Single User**. !!! note You can use Shortcuts such as `@Today` or `@Now` in the **Valid To** field, which will be replaced by the date/time of the event when it occurs. 2. Select **Create** to complete the operation. ![Screenshot showing a UI with options for creating an event rule.](images/create_event_rule_02.png)