File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Server-Side Components/Script Includes/Count Assigned To Field Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ Count Assigned To Field
2+
3+ 1 . Create a Script Include
4+ 2 . Enable Client Callable
5+ 3 . create a Function in the Script Include Class
6+ 4 . Do Glide Aggregate to the Incident Table
7+ 5 . Get the Parameter from the Client Script
8+ 6 . Use the Aggregate - COUNT for the assigned_to field
9+ 7 . Use the While Loop
10+ 8 . Get the COUNT of the assigned_to field
11+ 9 . Return the COUNT to Client Script
12+ 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 1+ var countAssignedUtil = Class . create ( ) ;
2+ countAssignedUtil . prototype = Object . extendsObject ( AbstractAjaxProcessor , {
3+
4+ getCount : function ( ) {
5+ var ga = new GlideAggregate ( 'incident' ) ;
6+ ga . addQuery ( 'assigned_to' , this . getParameter ( 'sysparm_assignedto' ) ) ;
7+ ga . addAggregate ( 'COUNT' , 'assigned_to' ) ;
8+ ga . query ( ) ;
9+ while ( ga . next ( ) ) {
10+ var assignedIncident = ga . getAggregate ( 'COUNT' , 'assigned_to' ) ;
11+ return assignedIncident ;
12+ }
13+ } ,
14+ type : 'countAssignedUtil'
15+ } ) ;
You can’t perform that action at this time.
0 commit comments