Create one header menu named as "Incident" which will display the count of incidents assigned to the logged-in user. In the header menu of the service portal, I wanted to show the number of incident counts.

Rushikesh5
Giga Guru

Hi All,

Can you please help me with this

Create one header menu named as "Incident" which will display the count of incidents assigned to the logged-in user.

In the header menu of the service portal, I wanted to show the number of incident counts.

 

 

Thanks in advance

1 ACCEPTED SOLUTION

data.items=[]; // Array to be displayed when clicked on menu
data.count=0; // Indicates number of records

var incGr = new GlideRecord('incident');
incGr.addQuery('caller_id',gs.getUserID())
incGr.query();
while(incGr.next()){
var obj={};
obj.title=incGr.getValue('number');
obj.type='link';
obj.href='/sp?id=ticket&table=incident&sys_id='+incGr.getUniqueValue();
data.items.push(obj);
data.count++;

}

 

use the above script in scripted list that will work

 

View solution in original post

11 REPLIES 11

Rushikesh5
Giga Guru

Hi 

I have to do one modification in the same that 

If the count of incident is zero then ncidents menu should not visible 

Please help me with this

 

Thanks

Hi Rushikesh. that a default functionality 

 

if the data.count's value is zero. the incident menu item will not even show. 

then the menu item will not show.