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