> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levelblue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating ServiceNow Response Action Rules

<Icon icon="users" iconType="solid" /> Role Availability | ❌ Read-Only ❌ Investigator ✔️ Analyst ✔️ Manager

You can create orchestration rules in USM Anywhere that automatically trigger a ServiceNow response action when <Tooltip tip="Any traffic or data exchange detected by LevelBlue products through a sensor or external devices such as a firewall.">events</Tooltip>, <Tooltip tip="Alarms provide notification of an event or sequence of events that require attention or investigation.">alarms</Tooltip>, or <Tooltip tip="A known issue or weakness in a system, procedure, internal control, software package, or hardware that could be used to compromise security.">vulnerabilities</Tooltip> match the criteria that you specify. For example, you may create a rule where USM Anywhere automatically creates a new ServiceNow incident when a malware is detected, so that a member of your response team can manage and address the issue.

<Note>
  Before creating a ServiceNow response action rule, the BlueApp for ServiceNow must be enabled and connected to your ServiceNow instance. See [Configuring the BlueApp for ServiceNow](/documentation/usm-anywhere/alienapps-guide/servicenow/config-alienapp-servicenow) for more information.
</Note>

After you create a rule, new events, alarms, or vulnerabilities that match the rule conditions will trigger the ServiceNow response action to create a new incident. The rule does not trigger for existing events, alarms, or vulnerabilities.

## Creating a new rule

You can create a new rule from the Rules page. The **Rules** page provides access to all of your orchestration rules. The **Orchestration Rules** list includes suppression rules, alarm rules, filtering rules, notification rules, and response action rules. You can create new rules using the specific matching conditions that you have defined, as well as edit, delete, and enable or disable rules. (See [Orchestration Rules](/documentation/usm-anywhere/user-guide/rules-management/orchestration-rules) for more information about managing orchestration rules.)

## Creating a Response Action Rule

**To create a Response Action Rule via Settings > Rules**

1. Go to **Settings > Rules > Orchestration Rules**.
2. Click **Create Orchestration Rule > Response Action Rule** to define the new rule.

<Frame>
  <img src="https://mintcdn.com/levelblue-5324744e/WKvzNH1Td8kzeWqz/images/usm-anywhere/create-rule-response-action.webp?fit=max&auto=format&n=WKvzNH1Td8kzeWqz&q=85&s=c1863d42a9de9ed9690ebf26d16a78b6" alt="" width="1174" height="306" data-path="images/usm-anywhere/create-rule-response-action.webp" />
</Frame>

**To create a Response Action Rule via the BlueApp for ServiceNow page**

1. Go to **Data Sources > Blue Apps > Available Apps**.
2. Search for **ServiceNow**, and then click the tile.
3. In the BlueApp for Service Now page, go to the **Rules** tab.

<Frame>
  <img src="https://mintcdn.com/levelblue-5324744e/t7fB_r8gbn0wFVz_/images/usm-anywhere/blueapp-RespActRule.png?fit=max&auto=format&n=t7fB_r8gbn0wFVz_&q=85&s=05f84627cda30039479dfcf4eb4f1c11" alt="" width="1791" height="555" data-path="images/usm-anywhere/blueapp-RespActRule.png" />
</Frame>

4. Click **Response Action Rule**, and then define the conditions of the rule.

<Frame>
  <img src="https://mintcdn.com/levelblue-5324744e/bqp02ST3Ho3aigN9/images/usm-anywhere/blueapp-RuleCond.png?fit=max&auto=format&n=bqp02ST3Ho3aigN9&q=85&s=c800554643042e375eff317557ee1aee" alt="" width="1791" height="853" data-path="images/usm-anywhere/blueapp-RuleCond.png" />
</Frame>

5. Click **Next**.
6. Select **ServiceNow** from the **Action Type** dropdown.
7. Click **Save**.

<Frame>
  <img src="https://mintcdn.com/levelblue-5324744e/bqp02ST3Ho3aigN9/images/usm-anywhere/blueapp-RespAction.png?fit=max&auto=format&n=bqp02ST3Ho3aigN9&q=85&s=48a491417ca44089078a3a873478403b" alt="" width="1791" height="853" data-path="images/usm-anywhere/blueapp-RespAction.png" />
</Frame>

## Defining ServiceNow response based on orchestration

**To define a new ServiceNow response based on orchestration**

1. Enter a name for the rule.
2. Select **ServiceNow** for Action Type and **Create a new incident** for App Action.
3. Set **Service Desk** as the Incident Type.

   <Frame>
     <img src="https://mintcdn.com/levelblue-5324744e/Q_BhWHm3qHRMbGha/images/usm-anywhere/servicenow-ra-rule.webp?fit=max&auto=format&n=Q_BhWHm3qHRMbGha&q=85&s=46555ade9697f7751e1c628034956fee" alt="" width="756" height="1550" data-path="images/usm-anywhere/servicenow-ra-rule.webp" />
   </Frame>

   USM Anywhere uses the title of the alarm, event, or vulnerability that triggers the rule to populate the short description of the incident.

   For a description of the incident, you can decide which fields to use by selecting the checkboxes as follows:

   * **Include Fields**: Select the checkboxes to include any of the information fields in your incident.
   * **Alarms**: Select the checkboxes to include any of these fields from an Alarm in your incident.
   * **Events**: Select the checkboxes to include any of these fields from an Event in your incident.
   * **Vulnerabilities**: Select the checkboxes to include any of these fields from a Vulnerability in your incident.
   * **Additional Comments**: Enter any additional information that you want to include in the notes field of the ServiceNow incident.

   <Note>
     The checkboxes are determined by those you selected on the **Data Sources > Integrations > ServiceNow > Settings** page when configuring the BlueApp.
   </Note>

   Additionally, you can further define the ServiceNow incident parameters that are populated by using the **Urgency**, **Impact**, and **Category** dropdown fields. You can also use the **Assign To** field to automatically assign all resulting incidents to a specific user. Use the drop-down list to select the correct user.
4. **(OPTIONAL)** Set the appropriate mapping template using the **Template** dropdown.

   <Note>
     The templates available to you are determined by your app's configurations under Mapping Templates. See [Configure ServiceNow Fields to Map to Equivalent USM Anywhere Fields](https://docs.levelblue.com/documentation/usm-anywhere/alienapps-guide/servicenow/config-alienapp-servicenow#configure-the-blueapp-for-servicenow-to-map-servicenow-data-fields-to-usm-anywhere-data-fields) for more information about using and configuring these templates.
   </Note>
5. At the bottom of the dialog box, set the rule condition parameters to specify the criteria for a matching alarm or event to trigger the rule.

   <Frame>
     <img src="https://mintcdn.com/levelblue-5324744e/MlnJpGwLYAWOIbAS/images/usm-anywhere/rules-conditions.webp?fit=max&auto=format&n=MlnJpGwLYAWOIbAS&q=85&s=ab8b4ad291c81ed750be057ef5b00663" alt="" width="576" height="192" data-path="images/usm-anywhere/rules-conditions.webp" />
   </Frame>

   * This section provides suggested property/value pairs from the selected alarm or event that you can use as conditions for the rule. Click  <img src="https://mintcdn.com/levelblue-5324744e/9HhQ6wK11ydctaHc/images/usm-anywhere/trash-alt.svg?fit=max&auto=format&n=9HhQ6wK11ydctaHc&q=85&s=2a750f9ee3d6466fc6799984309cddf0" className="inline m-0" width="24" height="24" data-path="images/usm-anywhere/trash-alt.svg" /> to delete the items that you do not want to include in the matching conditions. You can also add other conditions that are not suggested.
   * If you create the rule from the **Rules** page, you must use the **Add Condition** and **Add Group** functions to define the property/value pairs that you want to use as conditions for the rule.
   * At the bottom of the dialog box, click **More** to display the optional multiple occurrence and window-length parameters.

   <AccordionGroup>
     <Accordion title="Conditional Expression">
       Select an operator and add one or more conditions to form the conditional expression. You can include a condition group to evaluate a subset of conditions. The **Current Rule** pane displays the constructed expression in standard syntax. The box displays a red border if the expression is syntactically invalid as currently specified. A valid expression is required to save the rule definition.

       Select the operator used to determine the match for multiple conditions:

       * **AND**: Match all conditions.
       * **OR**: Match any one condition.
       * **AND NOT**: Exclude items matching all conditions after the first.
       * **OR NOT**: Include all items that do not match any conditions after the first.

       Click **Add Condition** to add a condition. For each condition, specify the field name, evaluator, and value. If the evaluation returns true for the condition, it is a match.

       Click **Add Group** to add a condition group. A new group includes a condition and its own operator used to match the conditions within the group. You can nest condition groups.
     </Accordion>

     <Accordion title="Occurrences">
       Specify the number of event or alarm occurrences that produce a match on the conditional expression to trigger the rule. The default value is 1. You can enter the number of occurrences or use the arrow to scroll the value up or down.

       USM Anywhere uses this in conjunction with the Length option to specify the number of occurrences within a time period that will trigger the rule. For example, you can define a rule to trigger for an unauthorized access attempt when a failed SSH login occurs three times within a five-minute window.
     </Accordion>

     <Accordion title="Length">
       Specify the length of the window to identify a match for multiple occurrences. Enter the number and choose a time unit value of seconds, minutes, or hours. This time period identifies the amount of time that transpires from the first occurrence to the last occurrence. If the number of occurrences is not met within this period, the rule does not trigger.
     </Accordion>
   </AccordionGroup>
6. Click **Save Rule**.
7. In the confirmation dialog box, click **OK**.
