Need help in Creating the Maintenance rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2025 02:18 PM
I am working on the Maintenace rules logic to apply MM if a user raises a Change with affected CI's . I have tried the selected the CIs Affected[task_ci] table but I am not able to see all the below fileds to choose the filter condition .. I can only see the type but not task.type or task.state.. could you please help me on this .how to create a MM rule to fetch the records from the change window affected CI's and based on the planned start time and Planned end time and apply MM on the event mangement Alerts.
Trying to understand how alerts Maintenance flag will be
1.my question is how MM rules will apply(Interval of time) based on the affected CI’s to make the alert Maintenance filed true..
2.for updating the alert MM field to true how this mechanism work ? do we need to handle in the MM rules to update the alert MM field to true if the affected CI’s is in the list of a active change
3.I want to understand the Priority as well .. I want to this MM rules to apply first and then other working subflow to do the enrichment of the alert.. fir this what we need to do ?
4.for updating the alerts MM field do I need to write a separate logic in MM rules or need to go with a new business rule to apply the MM field true ? or by default if the MM is having the affected CI’s list then incoming alerts MM filed will be enabled . if yes how to confirm the priorities of all the flows sub flow or business rules ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 06:01 AM
I've worked on creating a Maintenance Rule for Affected CIs. It's been a minute but let me see if I can at least get you started with some of your questions.
First, make sure you've checked out some of the doc on Maintenance Rules: https://www.servicenow.com/docs/bundle/yokohama-it-operations-management/page/product/event-manageme...
https://www.servicenow.com/docs/bundle/yokohama-it-operations-management/page/product/event-manageme...
CIs from Maintenance Rules are added to the table: em_impact_maint_ci
1. Interval of Time: There is a scheduled job, "Event Management - Maintenance Calculator," that runs once a minute.
2. The Maintenance Rules are the logic used to add the CIs to the em_impact_maint_ci table. So, once a minute, it looks to see if anything needs to be added or removed from that table. Out of the box, it just looks for the CIs that have the change window and not the Affected CIs.
3. The Maintenance Rules set the "Maintenance" flag on the Alerts. Which just gives you another thing you can filter on. So in our environment, we don't want to create incidents while the maintenance window is open, so we have "Maintenance IS false" in our Alert Management Rules to filter them out. In another scenario, we've added a flag that can be passed to auto-close Alerts in Maintenance, so that we check for our flag and "Maintenance IS true." One thing to keep in mind here: Once a CI is no longer in the em_imapct_maint_ci table, the flag is unchecked, which updates the Alert, and that triggers Alert Management Rules checks again. So, once the change window is complete, if a Resolution event hasn't come through, an incident (or whatever other processing you may be doing) will trigger.
4. If you want anything besides the out of the box behavior to be added to the em_impact_maint_ci table, you need to create a Maintenance Rule for it. We had to add 2 rules, one for Affected CIs, and one for a different Approval being used that wasn't captured in the OOB rules.
I hope that helps some.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 09:05 AM
Thank you so much for your prompt reply ..
the default Maintenance rules with Name "CI in Change Window" with below code is not pulling the active change and updating in the em_impact_maint_ci table.
(function findCisInMaint(){
var impactManager = new SNC.ImpactManager();
var cis = impactManager.getCisInActiveChangeWindow();
return cis;
})();
2. So I developed a Custom Maintenance rules with the below logic where this will check the active change request table where the Change is in "Implement state" and Suppress_Console flag is true then pull the change numbers and respective affected CI's from the task_ci table and storing in a array.
here I am not sure the relation between the Maintenance rules and Event Management - Maintenance Calculator ? if i have the list of affected CI's in a array how this maintenance calculator will update the affected CI's to the em_impact_maint_ci table ?
coming to the below script it is updating the table fields but unfortunately the CI's fields are empty and not sure why ? and also I manually tried created new with my CI's but automatically it is getting deleted.
Please guide me on this as I am new to this tool ..we have done the POC and successfully moved the ITOM to production .. now we are working on this MM to move the logic to prod .