incident table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 03:28 AM
how to get count of incident assigned to able tuter
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 04:05 AM
Hi @soniya patil,
Please find below the script for your query.
var sysId = 'user_sys_id_here';
var grIncidentCount = new GlideAggregate('incident');
grIncidentCount.addQuery('assigned_to', sysId);
grIncidentCount.addQuery('active', true);
grIncidentCount.addAggregate('COUNT');
grIncidentCount.query();
if (grIncidentCount.next()) {
var incidentCount = grIncidentCount.getRowCount();
gs.addInfoMessage("Total Incidents Assigned: " + incidentCount);
} else {
gs.addInfoMessage("No incidents found for the given user.");
}
Thanks,
Kapil Khedkar
Please do the needful if you find this solution helpful.