- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 02:20 AM
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
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 03:52 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 03:35 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2022 04:13 AM
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.