<h2>Alert does not get updated to closed when related incident is resolved</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><p style="padding-left: 40px;">Alert didn't get close when the related incident which is linked to the alert got closed/resolved if the alert Severity is Information.</p></section></div><div ><h3 >Release</h3><section><p style="padding-left: 40px;">All Versions.</p></section></div><div ><h3 >Resolution</h3><section><p style="padding-left: 40px;">The below script include will be used to check "Alerts" that have closed "Incidents" and it will close the related "Alerts":</p> <p style="padding-left: 40px;">EvtMgmtAlertActions.</p> <p style="padding-left: 40px;"><span style="font-family: 'courier new', courier;">https://Instance_name.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=c9c24f6453b003000238ddeeff7b128a</span><br /><br />Here is the code extract: </p> <pre style="padding-left: 40px;"><code><span style="font-family: 'courier new', courier;"> var alert = new GlideRecord('em_alert');</span><br /><span style="font-family: 'courier new', courier;"> // Get alerts with delay, this makes sure all BR on create/update alerts completed before the job is running</span><br /><span style="font-family: 'courier new', courier;"> alert.addQuery('sys_updated_on', '<=', inProgress);</span><br /><span style="font-family: 'courier new', courier;"> alert.addQuery('state', '!=', 'Closed');</span><br /><span style="font-family: 'courier new', courier;"> alert.addQuery('severity', '!=', '5'); ////<strong> <<<===== This will exclude Info Alerts.======>>>></strong></span><br /><br /><span style="font-family: 'courier new', courier;"> alert.addNotNullQuery('incident');</span><br /><span style="font-family: 'courier new', courier;"> var gr = alert.addJoinQuery('incident', 'incident', 'sys_id');</span><br /><span style="font-family: 'courier new', courier;"> gr.addCondition('state', 'IN', '6,7'); // 6 - Resolved or 7 - Closed</span><br /></code></pre> <p style="padding-left: 40px;"><br />The highlighted line will ignore Alerts with info severity because the expectation is that for Info Alerts, there will no Incidents created.<br /><br />If the alert Severity is "Info", the alert will be not be captured with the above query and it will not get closed.</p></section></div></article></div>