Skip to content

Commit 4b74b7e

Browse files
authored
Create glideAjaxIncidentCiCount.js
1 parent 632d717 commit 4b74b7e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var ConfigurationIncidentCheck = Class.create();
2+
ConfigurationIncidentCheck.prototype = Object.extendsObject(AbstractAjaxProcessor, {
3+
getIncidentCount: function() {
4+
var ci = this.getParameter('sysparm_ci');
5+
if (!ci) return 0;
6+
7+
var gr = new GlideAggregate('incident');
8+
gr.addQuery('cmdb_ci', ci);
9+
gr.addQuery('state', 'NOT IN', '6,7,8');
10+
gr.addAggregate('COUNT');
11+
gr.query();
12+
13+
return gr.next() ? gr.getAggregate('COUNT') : 0;
14+
},
15+
16+
type: 'ConfigurationIncidentCheck'
17+
});

0 commit comments

Comments
 (0)