We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff32526 commit e59b3d6Copy full SHA for e59b3d6
Server-Side Components/Business Rules/CountRelatedIncident/Count Incidents.js
@@ -0,0 +1,14 @@
1
+(function executeRule(current, previous /*null when async*/) {
2
+
3
+var problemSysId = current.sys_id;
4
+var agg = new GlideAggregate('incident');
5
+agg.addQuery('problem_id', problemSysId);
6
+agg.addAggregate('COUNT');
7
+agg.query();
8
9
+if (agg.next()) {
10
+ var incidentCount = agg.getAggregate('COUNT');
11
+ gs.addInfoMessage('There are ' + incidentCount + ' incidents related to this problem.');
12
+}
13
14
+})(current, previous);
0 commit comments