How to display incident information on critical incident map?

senon
Tera Sage

Hello, expert.

I would like to use the critical incident map, but when I register an incident with a priority of 1 - critical, it does not show up in the map.

What information does the critical incident map use to identify the location?

 

2 REPLIES 2

Kasi Ramanathan
Kilo Guru

Critical incident map will be using the latitude and longitude to identify a location.

 

Kindly navigate to System Map Page --> Map Pages. Open the record related to Critical Incident Map.

Validate the script. Make sure you have filled the location field when creating an incident.

Also make sure the location is having the longitude and latitude details.

find_real_file.png

 

Script:

var gr = new GlideRecord("incident");
gr.addQuery('priority', '1');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
    if (gr.location.latitude && gr.location.longitude) {
        var item = map.addItem(gr);
        item.latitude = String(gr.location.latitude);
        item.longitude = String(gr.location.longitude);
        item.dialog_title = gr.getDisplayValue();
        item.icon = "https://maps.google.com/mapfiles/kml/pal3/icon51.png";
        item.icon_width = "32";
        item.icon_height = "32";
    }
}

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Create or edit a Map Page from System UI > Map Page > (here editing 'Critical incidents' Page) You can filter based on your interest, the priority = 1 is the default case in this example.

var gr = new GlideRecord("incident");
gr.addQuery('priority', '1');
gr.addActiveQuery();
gr.query();
while (gr.next()) {
	if(gr.location.latitude && gr.location.longitude){
	   var item = map.addItem(gr);
	   item.latitude = String(gr.location.latitude);
	   item.longitude = String(gr.location.longitude);
	   item.dialog_title = gr.getDisplayValue();
	   item.icon = "https://maps.google.com/mapfiles/kml/pal3/icon51.png";
	   item.icon_width = "32";
	   item.icon_height = "32";
	}
}

We drive the maps from user table, which is the best way to display the location map in any task record (incident, change, catalog task etc.,) For this you can map each user to a particular location and in the location record, make sure you notice latitude and longitude as a basic requirement.