Critical Incidents Map

WESAdmin
Kilo Contributor

Has anyone utilised the Critical Incidents Map, most notably to highlight active "Critical" Incidents only?

 

I like the script that displays Marker Labels, last script shown here, Using Map Pages - ServiceNow Wiki, but this shows all Incidents, there's no query on the Priority of the active incident.   I'm no scripter so was wondering if anyone has utilized this particular script to do as is but also query the priority and only display Critical?

9 REPLIES 9

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi WESAdmin



If you looking for all "active" incidents with priority as "critical" then OOB Business rule does this for you.


In case you want to modify the business rule according to your condition then


Go to :System UI->Map pages->Critical incidents


Please let me know if you have any questions.




Thanks and Regards


Pradeep Sharma


Maybe I wasn't clear in what I was asking...   I am aware of the OoTB business rules, however I would like to use the script as described in my original comment (this one https://wiki.servicenow.com/index.php?title=Using_Map_Pages#Marker_Label_Sample), however when using this script I cant seem to get it to "ONLY" look at Critical (active) Incidents, it shows all active Incidents.   I'm guessing it is because it is not checking the Priority of the Incident (at least from what I can see anyway).   I have tried adding a line to the script to check the priority but it seems to break the script altogether and then does nothing at all.   Wondering if this has something to do with server/client run scripts??



//get the instances url so we can link back to it


var uri = gs.getProperty("glide.servlet.uri");


//create an aggregate query on the incident table


var count = new GlideAggregate('incident');


//set condition for active incidents


count.addQuery('active', 'true');


//set condition for critical incidents


count.addQuery('priority', '1');


//set aggregate field to location to get count by location


count.addAggregate('COUNT', 'location');


//execute the query


count.query();


I used the existing Map page 'Incident Count By Location' and just added one line :


count.addQuery('priority', '1');


The map looks fine to me. Can you check with different browsers if there is anything to do with browser?


have tried in the following browsers;


  • IE = doesnt work
  • Firefox = doesnt work
  • Chrome = doesnt work