(ServiceNow ) gs . info ( "checking list of today's Alerts by common problemID" ); var grAlerts = new GlideRecord ( 'em_alert' ); grAlerts . addQuery ( 'source' , 'SGO-Dynatrace' ); grAlerts . addEncodedQuery ( 'sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()' ); grAlerts . query (); grAlerts . orderBy ( 'message_key' ); gs . info ( 'TOTAL SGO ALERTS FOR TODAY: ' + grAlerts . getRowCount ()); var dupl_prbID_arr = []; var dupl_cmdbci_arr = []; while ( grAlerts . next ()){ var sAddInfo = JSON . parse ( grAlerts . additional_info ); var sProblemID = sAddInfo . ProblemID + "" ; //gs.info('message key=' + grAlerts.message_key + '; ProblemID=' + sProblemID); dupl_cmdbci_arr . push ( grAlerts . cmdb_ci + "" ); dupl_prbID_arr . push ( sProblemID ); } dupl_prbID_arr . sort (); dupl_cmdbci_arr . sort (); c...
All things ServiceNow... take a look at my channel: https://www.youtube.com/@cloudminus89