---
sourceDocument: Australia IT Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/it-operations-management

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Create maintenance rules

# Create maintenance rules {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 Minuten Lesedauer

Use maintenance rules to mark CIs in maintenance status. When in maintenance status,
these CIs are excluded from impact calculation.

## Vorbereitungen

Role required: evt_mgmt_admin

## Warum und wann dieser Vorgang ausgeführt wird

You can define rules to mark CIs that match the specified criteria as being in
maintenance status. The marked CIs populate the Impact Maintenance CIs
\[em_impact_maint_ci\] table.  
Hinweis:  
When running maintenance rules, the cmdb_ci status of matching CIs is not changed. However, matching CIs are flagged in the em_impact_maint_ci table by these rules and this status is considered for impact and alert calculations.

The field flagged by this rule as being in maintenance status is the CMDB status
field.  
Hinweis:  
To activate a maintenance rule, select the Active field in the maintenance rule. To deactivate a maintenance rule, clear the Active field.  
The maintenance rules provided with the base instance are:{#create-maintenance-rule__table_qvy_w5f_qz__entry__2}

| Default maintenance rule | Description |
|:-|:-|
| CI in Change Window | Where the CI has an active change window, the matching CIs are marked as being in maintenance status. The rule runs a query against the change request \[change_request\] table to determine whether the rule is applied. All these conditions in the change_request table must be met: * State is one of these options: Scheduled, Implement, Work in Progress, or Open/New (state in (-2, -1, 1, 2)). * Approval is Approved (approval = 'approved'). * The change request window is active, that is, the current time is between Planned start date and Planned end date, or the current time is between Actual start date and Actual end date. * The change request record is not an on-hold record (on_hold='false'). {#create-maintenance-rule__ul_ujk_wvf_qz} Note: All these conditions must be present for the CI to be placed in maintenance status by this rule. For example, if the State of the change request approval status is `Change is waiting for approval`, then the change is not added to the em_impact_maint_ci table. |
| Maintenance status of CI | CIs whose CMDB status field is In Maintenance are flagged by this rule as being in maintenance status. By default, retired CIs are not included in CIs that are In Maintenance. To include retired CIs: 1. Navigate to All Properties. 2. Select New. 3. Configure the evt_mgmt.maintenance_rule_include_retired property with Value = true. {#create-maintenance-rule__ol_tkh_fpd_pgb} Hinweis: Including thousands of retired CIs may decrease system performance. |
[ ]

{#create-maintenance-rule__table_qvy_w5f_qz}

## Prozedur

1. Navigate to AllEvent ManagementRulesMaintenance Rules.
2. Click New.
3. Fill in the fields, as appropriate.  
   {#create-maintenance-rule__table_osj_py4_dx__entry__2}

   | Column heading | Description |
   |-|-|
   | Name | The maintenance rule name. |
   | Active | Select to activate the maintenance rule. |
   | Advanced | Select to enable the optional script section to display. |
   | Description | Information that describes this maintenance rule. |
   | Flag CIs that run on this host | Select to flag all applications running on the recognized host as being in maintenance. |
   | Table | Select the table that contains the CI that you require. |
   | Filter | Specify how to select the data. |
   | CI field name | Select the CI from the list. The list is populated according to your selection in the Table field. If a CMDB table, or a table derived from CMDB, was selected, specify <kbd class="ph userinput">sys_id</kbd> for the CI field name. Otherwise, specify the required CI field that you want to use. See the examples. |
   [ ]

   {#create-maintenance-rule__table_osj_py4_dx}
4. Click Submit.

## Beispiel

Example of a maintenance rule using a CMDB table.

Assume that a company defines
a CI as being in maintenance when the Operational Status of the CI is either
Repair in Progress or DR Standby.

Example of a maintenance rule using a table other than CMDB.

Assume that a company uses Incident records to track maintenance. Any
maintenance request is translated to an incident when it has a description that
starts with "Performing maintenance on CI". As long as the status of such an
incident is open, this status indicates that the maintenance is in progress. For the
CI field name field, specify a CI name from the table
that was chosen, in this case Incident.

Example of a maintenance rule that uses the advanced script
feature.  
In the Maintenance Rule page, select the Advanced option. Customize the provided example script:

    var now_GR = new GlideRecord('cmdb_ci');
    gr.addQuery('name', 'your_name_here');
    gr.query();
    while (gr.next()){
     result.push(gr.sys_id +'');}

The return value for this example script is a text string that represents an array of CI IDs, for example, \['sys_id1','sys_id2','sys_id3'\].

You can use this script as an example to prepare
your own customized script.

**Zugehörige Konzepte**   

* [How alerts work with CIs in maintenance](https://servicenow-prod.fluidtopics.net/iqGEg9eOh7qT4SlbySrK1w "When a CI is in maintenance, the impact tree, the service map, and Alerts tab are updated based on various factors.")  
**Zugehörige Tasks**   

* [Place an alert into maintenance](https://servicenow-prod.fluidtopics.net/AXppNAe1nG1jItVWct_bmg "You can manually place any alert into maintenance to hide it from the Alerts list and Agent Workspace.")

