OBLYTECH Logo
OBLYTECH Logo

ServiceNow Alert Management Rules: Filters, Actions and Checks

An alert management rule tells ServiceNow Event Management how to respond when an alert matches conditions you set. The response can open an incident or task, run a remediation subflow, or launch a link built from alert fields. Each rule pairs a filter with a list of actions, and is built in the Alert Management Rules list.

What an alert management rule does

The rule holds the response, and the filter decides when it applies. Filters also stop a rule from running on updates that do not matter, such as a work notes change. The base system ships ready-made rules through the Alert Rules Management store application (sn_em_arm), and each run is recorded in the alert’s execution history. If your instance includes Service Operations Workspace, its Respond automation is the newer route; this page covers the alert management rule designer.

The parts of a rule and how to set them

A rule has three sections. Define the filter before the actions, because the actions depend on it.

Section What you configure What to watch for
Alert Info Name, description, order, assignment group and the Active check box An active rule needs a filter and at least one action
Alert Filter Conditions on the alert, plus optional related list conditions Overall Event Count, Priority, Priority Group, Priority Breakdown, Tags and Impacted Services cannot be used in filters
Actions Remediation subflows and launch applications, with run mode and limits Remediation workflows are deprecated; use Flow Designer for flows triggered by alerts

To create a rule, go to Event Management, open Rules, choose Alert Management Rules, click New and fill in the form. This needs the evt_mgmt_admin role together with flow_designer. A rule with no action configured is skipped and set to inactive automatically.

When a rule runs

Rules run on open alerts that have been updated. A closed alert is skipped, even when it is updated.

A scheduled job, Event Management – Evaluate Scoped Alert Rules Management0, checks the rules on an 11-second cycle by default. New users starting from the Vancouver release also get Management1; upgraded instances keep the single job. Leave the sn_em_arm.alert_management.num_of_jobs property unchanged.

Separately, a rule runs 5 seconds after an alert update, and each further update inside that window resets the timer. This keeps remediation, such as incident creation, from firing while an alert is still changing. To change the value, create the system property evt_mgmt.alert_rule_delay. Rules do not necessarily finish in the order they are invoked.

Choosing how the filter is matched

The “Rule is activated when” setting controls how often the actions run.

Setting When the rule applies Later updates
Alert changes to When an update makes the alert start matching A later update that still matches does not reapply the rule. If the alert closes and reopens, the next matching update applies it
Alert matches filter On any update where the alert matches The rule runs again on each matching update

Conditions and related lists

Build conditions with the condition builder, and use New Criteria to add more. For time-based conditions, use Updated on. The Created on condition is not used by the job that evaluates rules, because the job detects alerts by update time.

Related list conditions widen the filter to another table, such as a condition on the Alert > Parent relationship that filters for alerts received today. The filter preview counts matching alerts, including closed ones, but does not mark those the rule has already run against.

Actions: subflows, applications and quick responses

Remediation subflows

Open the Subflow cell in the Remediation Subflows area and search for a subflow. Base-system subflows appear there, and a custom subflow appears once it is published. Then choose the Execution option.

Execution option How the subflow runs
Automatic Runs as soon as the rule matches
Manual Runs when someone chooses to start it after a match
Both Runs automatically on a match, and can also be started by hand

Set the Automatic executions limit to an integer; once the subflow has run that many times, it stops running for that rule. Set its Active cell to true. The Link to Flow Designer appears once the subflow is chosen and the rule is saved.

Subflows suit the evaluation job better than workflows do, while orchestration workflows still fit scripted remediation such as restarting a server.

Launch applications

Under Launch Applications, name the link and compose its URL from alert fields such as the source, port and configuration item name.

Quick responses

Operators can act on one alert without waiting for a rule. Right-click the alert in the All Alerts list and select Quick Response. If no remediation link appears, enable remediation on the rule, pick an orchestration workflow that uses the Remediation Task table, publish it and update the rule.

Order, assignment groups and maintenance

Each rule has an Order value that defaults to 100. Rules are evaluated in ascending order, so a lower number has higher priority. The Multiple alert rules setting decides whether matching continues (“Search for additional rules”) or stops after the current rule.

A rule with no assignment group is global, and global rules run first. An alert is marked In Maintenance when a user action binds it to a configuration item in the Maintenance state, and the base incident rules leave those alerts out.

The base-system rules

The base system ships nine rules. The table shows a selection of them and each one’s default active setting.

Rule What it does Active by default
Create Incident on Primary Critical Alert Creates an incident for primary critical alerts, automatically or by hand No
Search Google for “description” Opens a browser search built from the alert description Yes
Create Incident Creates an incident for alerts not in maintenance, running on selective update No
Create Incident Manually Lets an operator create an incident for alerts not in maintenance Yes
Create Major Incident Candidate Creates a candidate for alerts that are neither in maintenance nor secondary No
Create Major Incident Creates a major incident for alerts that are neither in maintenance nor secondary No

After an upgrade from Kingston, edits made to modified Kingston rules do not carry over.

Building a custom subflow

A custom subflow lets a rule resolve alerts, notify teams or run remediation your own way. Copy the base Create Incident subflow in Flow Designer as a starting point. It receives six inputs: alertRuleName, alertRuleId (the rule’s sys_id), alertGR (the matching alert record), executionId, userName and userDisplayName. To see live values, open the Link to execution from a rule’s Alert Executions list, then Subflow Inputs and Outputs.

Use the more actions menu and choose Copy subflow. Name it, set the application scope to a specific application or Global, and copy. Inputs are fixed, so you can delete one but cannot add one. Add outputs with a name and data type. Save keeps a draft, and Publish makes the subflow available in the rule designer. On instances that use domain separation, keep the subflow to its designated domain.

Checking what a rule has done

The Alert Executions list in a rule’s record appears once an alert has matched and an action has run. It shows the matching alert, the action name, a link to the execution log, any related incident or task, and a log status such as “1 out of 2 executions”. That status resets to 0 when the alert closes. It confirms the subflow call succeeded, not that the subflow finished its work, so open the execution log to check the outcome.

Migrating older alert action rules

Alert action rules from an earlier release can still run, but they cannot be edited until migrated. Select the rule under Alert Action Rules and click Migrate, which needs evt_mgmt_admin. The migrated rule then appears under Alert Management and can be changed.

Stopping duplicate incidents on secondary alerts

By default the alert grouping job and the alert management job run independently, so an incident can be opened on an alert that a later grouping run marks as secondary. Enable Avoid Incidents on Secondary alerts and wait for Grouping job to be executed in Event Management Properties, which sets evt_mgmt.avoid_int_enabled. Then add the condition Role in Group is not Secondary, joined with And, to the rule’s filter. Note the first-alert case: if one alert exists when the management job runs, an incident is created, and a second alert arriving later forms a group and opens a second incident.

Resolving an incident and closing the alert

Resolving an incident linked to an alert can affect the alert, as set by evt_mgmt.incident_closes_alert. The alert may close after a delay set by the evt_mgmt.alert_rule_close_delay property, a number of seconds you define by creating that property with the value you need.

Frequently asked questions

Who can create or change an alert management rule?

Creating and customising rules needs evt_mgmt_admin, and building a subflow also needs flow_designer. Users with evt_mgmt_operator can run rules by hand.

Why did a rule not run on an alert that was already closed?

Rules run on open alerts, so a closed alert is skipped even when it is updated. If the alert reopens, the next matching update can apply the rule.

Why did two incidents appear for related alerts?

The management job probably ran before grouping formed a group. Turn on the avoid-incidents property and add the Role in Group condition to the filter.

Where can I see what a rule did?

Check the Alert Executions list in the rule’s record. Each row links to the execution log.