Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Count Assigned To Field

1. Create a Script Include
2. Enable Client Callable
3. create a Function in the Script Include Class
4. Do Glide Aggregate to the Incident Table
5. Get the Parameter from the Client Script
6. Use the Aggregate - COUNT for the assigned_to field
7. Use the While Loop
8. Get the COUNT of the assigned_to field
9. Return the COUNT to Client Script
10. Based on the COUNT we can add limit the assignment of the tickets to the assigned users.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var countAssignedUtil = Class.create();
countAssignedUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {

getCount: function() {
var ga = new GlideAggregate('incident');
ga.addQuery('assigned_to', this.getParameter('sysparm_assignedto'));
ga.addAggregate('COUNT', 'assigned_to');
ga.query();
while (ga.next()) {
var assignedIncident = ga.getAggregate('COUNT', 'assigned_to');
return assignedIncident;
}
},
type: 'countAssignedUtil'
});
Loading