<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Alert Correlation Rules in ITOM forum</title>
    <link>https://www.servicenow.com/community/itom-forum/alert-correlation-rules/m-p/2615563#M109779</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;In ServiceNow, for alerts coming from different sources, let me know script to define primary and secondary alerts in alert correlation rule.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 14:00:24 GMT</pubDate>
    <dc:creator>Shaziya Sayed</dc:creator>
    <dc:date>2023-07-17T14:00:24Z</dc:date>
    <item>
      <title>Alert Correlation Rules</title>
      <link>https://www.servicenow.com/community/itom-forum/alert-correlation-rules/m-p/2615563#M109779</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;In ServiceNow, for alerts coming from different sources, let me know script to define primary and secondary alerts in alert correlation rule.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:00:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/alert-correlation-rules/m-p/2615563#M109779</guid>
      <dc:creator>Shaziya Sayed</dc:creator>
      <dc:date>2023-07-17T14:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alert Correlation Rules</title>
      <link>https://www.servicenow.com/community/itom-forum/alert-correlation-rules/m-p/2620986#M109904</link>
      <description>&lt;P&gt;Hello I am Expert in this field so that i write code into my answer please try it and tell me ho was this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// This is a sample script to define primary and secondary alerts in an alert correlation rule.&lt;/P&gt;&lt;P&gt;// Define the primary alert condition (example: High severity alerts from a specific source)&lt;BR /&gt;var primarySource = 'SourceA';&lt;BR /&gt;var primarySeverity = '1'; // Assuming '1' represents high severity&lt;BR /&gt;var primaryAlerts = [];&lt;BR /&gt;var primaryAlertGr = new GlideRecord('em_alert'); // Replace 'em_alert' with the appropriate table name for alerts&lt;BR /&gt;primaryAlertGr.addQuery('source', primarySource);&lt;BR /&gt;primaryAlertGr.addQuery('severity', primarySeverity);&lt;BR /&gt;primaryAlertGr.query();&lt;BR /&gt;while (primaryAlertGr.next()) {&lt;BR /&gt;primaryAlerts.push(primaryAlertGr.getValue('alert_id'));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Define the secondary alert condition (example: Medium severity alerts from another source)&lt;BR /&gt;var secondarySource = 'SourceB';&lt;BR /&gt;var secondarySeverity = '2'; // Assuming '2' represents medium severity&lt;BR /&gt;var secondaryAlerts = [];&lt;BR /&gt;var secondaryAlertGr = new GlideRecord('em_alert'); // Replace 'em_alert' with the appropriate table name for alerts&lt;BR /&gt;secondaryAlertGr.addQuery('source', secondarySource);&lt;BR /&gt;secondaryAlertGr.addQuery('severity', secondarySeverity);&lt;BR /&gt;secondaryAlertGr.query();&lt;BR /&gt;while (secondaryAlertGr.next()) {&lt;BR /&gt;secondaryAlerts.push(secondaryAlertGr.getValue('alert_id'));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Now, correlate the primary and secondary alerts based on certain criteria.&lt;BR /&gt;// For example, you can create an incident and associate the secondary alerts with the primary alert.&lt;BR /&gt;if (primaryAlerts.length &amp;gt; 0) {&lt;BR /&gt;// Create an incident for the primary alert&lt;BR /&gt;var incidentGr = new GlideRecord('incident'); // Replace 'incident' with the appropriate table name for incidents&lt;BR /&gt;incidentGr.initialize();&lt;BR /&gt;incidentGr.short_description = 'Primary Alert Incident';&lt;BR /&gt;var incidentId = incidentGr.insert();&lt;/P&gt;&lt;P&gt;// Associate the secondary alerts with the incident (update the 'correlation_id' field)&lt;BR /&gt;var secondaryAlertGr = new GlideRecord('em_alert'); // Replace 'em_alert' with the appropriate table name for alerts&lt;BR /&gt;secondaryAlertGr.addQuery('alert_id', 'IN', secondaryAlerts);&lt;BR /&gt;secondaryAlertGr.query();&lt;BR /&gt;while (secondaryAlertGr.next()) {&lt;BR /&gt;secondaryAlertGr.correlation_id = incidentId;&lt;BR /&gt;secondaryAlertGr.update();&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's not too much trouble, note that this is only an example content, and you could have to tweak it in light of your particular use case, table names, and field values in your ServiceNow occasion. Moreover, try to completely test any ready connection rules prior to applying them in a creation climate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&am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biz/" target="_self"&gt;&lt;FONT color="#FFFFFF"&gt;mymilestonecard&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 04:34:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itom-forum/alert-correlation-rules/m-p/2620986#M109904</guid>
      <dc:creator>Spromilt</dc:creator>
      <dc:date>2023-07-22T04:34:06Z</dc:date>
    </item>
  </channel>
</rss>

