Skip to content

Commit cf23d5c

Browse files
authored
Create glideAjaxIncidentCount.js
1 parent 45d468b commit cf23d5c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var IncidentAssignmentCheck = Class.create();
2+
IncidentAssignmentCheck.prototype = Object.extendsObject(AbstractAjaxProcessor, {
3+
4+
getIncidentCount: function() {
5+
var user = this.getParameter('sysparm_user');
6+
var count = 0;
7+
8+
if (user) {
9+
var gr = new GlideAggregate('incident');
10+
gr.addQuery('assigned_to', user);
11+
gr.addQuery('state', 'NOT IN', '6,7,8');
12+
gr.addAggregate('COUNT');a
13+
gr.query();
14+
15+
if (gr.next()) {
16+
count = gr.getAggregate('COUNT');
17+
}
18+
}
19+
return count;
20+
},
21+
22+
type: 'IncidentAssignmentCheck'
23+
});

0 commit comments

Comments
 (0)