-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_management_plus.xml
518 lines (492 loc) · 31.5 KB
/
event_management_plus.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<?xml version="1.0" encoding="UTF-8"?><unload unload_date="2024-03-03 22:39:27">
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Global">global</application>
<application_name>Global</application_name>
<application_scope>global</application_scope>
<application_version/>
<collisions/>
<commit_date/>
<deleted/>
<description/>
<inserted/>
<name>Event Management Plus - Batch Parent</name>
<origin_sys_id/>
<parent display_value=""/>
<release_date/>
<remote_base_update_set display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</remote_base_update_set>
<remote_parent_id/>
<remote_sys_id>4ee5a31447b4c2101e4bf2b4116d4303</remote_sys_id>
<state>loaded</state>
<summary/>
<sys_class_name>sys_remote_update_set</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>b246e39447b4c2101e4bf2b4116d4369</sys_id>
<sys_mod_count>1</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<update_set display_value=""/>
<update_source display_value=""/>
<updated/>
</sys_remote_update_set>
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Global">global</application>
<application_name>Global</application_name>
<application_scope>global</application_scope>
<application_version/>
<collisions/>
<commit_date/>
<deleted/>
<description/>
<inserted/>
<name>Event Management Plus - Batch Child</name>
<origin_sys_id/>
<parent display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</parent>
<release_date/>
<remote_base_update_set display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</remote_base_update_set>
<remote_parent_id/>
<remote_sys_id>dea4235847b4c2101e4bf2b4116d4312</remote_sys_id>
<state>in_hierarchy</state>
<summary/>
<sys_class_name>sys_remote_update_set</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>0b46e39447b4c2101e4bf2b4116d436a</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<update_set display_value=""/>
<update_source display_value=""/>
<updated/>
</sys_remote_update_set>
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Alert Rules Management">31a0b01e1b706890591141d9bc4bcb31</application>
<application_name>Alert Rules Management</application_name>
<application_scope>sn_em_arm</application_scope>
<application_version>18.11.4</application_version>
<collisions/>
<commit_date/>
<deleted/>
<description/>
<inserted/>
<name>Event Management Plus - Batch Child</name>
<origin_sys_id/>
<parent display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</parent>
<release_date/>
<remote_base_update_set display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</remote_base_update_set>
<remote_parent_id/>
<remote_sys_id>0ae5e7d847b4c2101e4bf2b4116d43a4</remote_sys_id>
<state>in_hierarchy</state>
<summary/>
<sys_class_name>sys_remote_update_set</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>3e46e39447b4c2101e4bf2b4116d4369</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<update_set display_value=""/>
<update_source display_value=""/>
<updated/>
</sys_remote_update_set>
<sys_remote_update_set action="INSERT_OR_UPDATE">
<application display_value="Global">global</application>
<application_name>Global</application_name>
<application_scope>global</application_scope>
<application_version/>
<collisions/>
<commit_date/>
<deleted/>
<description/>
<inserted/>
<name>Event Management Plus - Batch Parent</name>
<origin_sys_id/>
<parent display_value=""/>
<release_date/>
<remote_base_update_set display_value="Event Management Plus - Batch Parent">b246e39447b4c2101e4bf2b4116d4369</remote_base_update_set>
<remote_parent_id/>
<remote_sys_id>4ee5a31447b4c2101e4bf2b4116d4303</remote_sys_id>
<state>loaded</state>
<summary/>
<sys_class_name>sys_remote_update_set</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>b246e39447b4c2101e4bf2b4116d4369</sys_id>
<sys_mod_count>1</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<update_set display_value=""/>
<update_source display_value=""/>
<updated/>
</sys_remote_update_set>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_script_435ba9962f1846104cc5dc1a2799b61b</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_script"><sys_script action="INSERT_OR_UPDATE"><abort_action>false</abort_action><access>package_private</access><action_delete>false</action_delete><action_insert>false</action_insert><action_query>false</action_query><action_update>true</action_update><active>false</active><add_message>false</add_message><advanced>true</advanced><change_fields>false</change_fields><client_callable>false</client_callable><collection>em_alert</collection><condition>((previous.state != 'Closed' &amp;&amp; current.state == 'Closed')||(previous.severity != '5' &amp;&amp; current.severity == '5') ||(previous.severity != '0' &amp;&amp; current.severity == '0')) &amp;&amp; current.incident !='NULL' &amp;&amp; current.incident !='' &amp;&amp; current.incident !=null</condition><description/><execute_function>false</execute_function><filter_condition/><is_rest>false</is_rest><message/><name>EMP Close associated incident</name><order>400</order><priority>100</priority><rest_method/><rest_method_text/><rest_service/><rest_service_text/><rest_variables/><role_conditions/><script><![CDATA[(function executeRule(current, previous /*null when async*/)
{
var alertManager = new SNC.AlertManager();
alertManager.addStep('Alert BR: Close associated incident (after)');
var taskRecord = new GlideRecord('task');
taskRecord.get(current.incident);
try
{
var additionalInfo = JSON.parse(current.additional_info);
}
catch (err)
{
gs.error('EMP - Unable to parse "additional_info" field for {0}.', current.number);
}
// Only handle incident tasks. Lines 30-49 in the OOB script appear to choose a state for task types other than
// "incident". We only care about linked incident tasks so that block was not used here.
if (taskRecord.sys_class_name == 'incident')
{
if (taskRecord.state != IncidentState.RESOLVED && taskRecord.state != IncidentState.CLOSED &&
taskRecord.state != IncidentState.CANCELED)
{
// check there are no alerts linked to this task that are not closed
var relatedAlerts = new GlideRecord('em_alert');
relatedAlerts.addQuery('sys_id', '!=', current.sys_id); // skip the current alert
relatedAlerts.addQuery('state', '!=', 'closed');
relatedAlerts.addQuery('severity', '!=', '5');
relatedAlerts.addQuery('severity', '!=', '0');
relatedAlerts.addQuery('incident', current.incident);
relatedAlerts.query();
if (relatedAlerts.getRowCount() == 0)
{
var behaviour;
if (additionalInfo.override_alert_closes_incident !== undefined)
{
behaviour = additionalInfo.override_alert_closes_incident;
}
else
{
behaviour = gs.getProperty('evt_mgmt.alert_closes_incident');
}
if (behaviour == 'close' || behaviour == 'resolve')
{
var closeCode;
if (additionalInfo.override_alert_incident_close_code !== undefined)
{
closeCode = additionalInfo.override_alert_incident_close_code;
}
else
{
closeCode = gs.getProperty('evt_mgmt.alert_incident_close_code');
}
var closeNotes;
if (additionalInfo.override_alert_incident_close_notes !== undefined)
{
closeNotes = additionalInfo.override_alert_incident_close_notes;
}
else
{
closeNotes = gs.getProperty('evt_mgmt.alert_incident_close_notes');
}
var incidentRecord = new GlideRecord('incident');
incidentRecord.get(taskRecord.getUniqueValue());
incidentRecord.close_code = gs.getMessage(closeCode);
incidentRecord.close_notes = gs.getMessage(closeNotes, current.number);
incidentRecord.state = (behaviour == 'resolve' ? IncidentState.RESOLVED : IncidentState.CLOSED);
// removed an OOB block which updated the "asset action" when Hardware Asset Management (HAM) is enabled
incidentRecord.update();
}
else if (behaviour == 'nothing')
{
// do nothing
}
else
{
gs.error(
'EMP - Unable to update {0} linked to {1}, the System Property "evt_mgmt.alert_closes_incident" ' +
'or the Event Rule manual attribute "override_alert_closes_incident" are not set correctly.',
taskRecord.number, current.number
);
}
}
}
}
else
{
gs.error('EMP - Unable to update {0} linked to {1}, unexpected task type ({2}).',
taskRecord.number, current.number, taskRecord.sys_class_name);
}
})(current, previous);
]]></script><sys_class_name>sys_script</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-02-13 22:54:11</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>435ba9962f1846104cc5dc1a2799b61b</sys_id><sys_mod_count>8</sys_mod_count><sys_name>EMP Close associated incident</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_script_435ba9962f1846104cc5dc1a2799b61b</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-03-03 22:25:43</sys_updated_on><template/><when>after</when></sys_script><sys_translated_text action="delete_multiple" query="documentkey=435ba9962f1846104cc5dc1a2799b61b"/></record_update></payload>
<payload_hash>-999245791</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">0b46e39447b4c2101e4bf2b4116d436a</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>0746e39447b4c2101e4bf2b4116d436b</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e06766f0b0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table>em_alert</table>
<target_name>EMP Close associated incident</target_name>
<type>Business Rule</type>
<update_domain>global</update_domain>
<update_guid>94b5279828b4c2107b860ea5f670c4d8</update_guid>
<update_guid_history>94b5279828b4c2107b860ea5f670c4d8:-999245791,c223af5409b4c210adf8580e60314c8f:-999245791,bdb0e5947db482109276159c9175a1a7:-2035379096,5f7dd99c8f748210a0ba2132e01fb527:1474011514,680bc9d02af0821061fc6b87ee6cdcc1:-2035379096,fac3a9c869b40210a8ebd248278f90ec:1722766540,e79519bb1364c2105eaa6d751cb07a5e:284537334,eaaf33832d900e106fea368a2c3568a0:1483233711,1e9c770b39500e1052bcb5f80378af78:1483233711,3e87356adcd4c6107395eb75c4321eb9:284537334,ca73399abc1846103f9312f723b825d2:1483233711</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_properties_ebd641d047f082101e4bf2b4116d43f7</name>
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_properties"><sys_properties action="INSERT_OR_UPDATE"><choices/><description>Close/resolution code for incidents linked to alerts.</description><ignore_cache>true</ignore_cache><is_private>false</is_private><name>evt_mgmt.alert_incident_close_code</name><read_roles/><suffix/><sys_class_name>sys_properties</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-03-03 11:05:25</sys_created_on><sys_id>ebd641d047f082101e4bf2b4116d43f7</sys_id><sys_mod_count>2</sys_mod_count><sys_name>evt_mgmt.alert_incident_close_code</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_properties_ebd641d047f082101e4bf2b4116d43f7</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-03-03 15:50:01</sys_updated_on><type>string</type><value>Solved Remotely (Permanently)</value><write_roles/></sys_properties><sys_translated_text action="delete_multiple" query="documentkey=ebd641d047f082101e4bf2b4116d43f7"/></record_update>]]></payload>
<payload_hash>-1874912704</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">0b46e39447b4c2101e4bf2b4116d436a</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>4346e39447b4c2101e4bf2b4116d436b</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e067456b10000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table/>
<target_name>evt_mgmt.alert_incident_close_code</target_name>
<type>System Property</type>
<update_domain>global</update_domain>
<update_guid>b625235838b4c21069073c3ebdfaa5c8</update_guid>
<update_guid_history>b625235838b4c21069073c3ebdfaa5c8:-1874912704,b5980ed067f8821012e95b6285947f6d:-1874912704,6a48c6d055f88210056431a839330c38:-1980378183,f4770514aaf08210aecc2051aa82f0dc:929558805</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_properties_dd42a95a2fd446104cc5dc1a2799b6ba</name>
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_properties"><sys_properties action="INSERT_OR_UPDATE"><choices>New=new, In Progress=in_progress, On Hold=on_hold</choices><description>Reopened alerts will have state:</description><ignore_cache>true</ignore_cache><is_private>false</is_private><name>evt_mgmt.alert_reopens_incident_state</name><read_roles/><suffix/><sys_class_name>sys_properties</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-02-13 21:43:30</sys_created_on><sys_id>dd42a95a2fd446104cc5dc1a2799b6ba</sys_id><sys_mod_count>1</sys_mod_count><sys_name>evt_mgmt.alert_reopens_incident_state</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_properties_dd42a95a2fd446104cc5dc1a2799b6ba</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-02-13 22:06:26</sys_updated_on><type>choicelist</type><value>in_progress</value><write_roles/></sys_properties><sys_translated_text action="delete_multiple" query="documentkey=dd42a95a2fd446104cc5dc1a2799b6ba"/></record_update>]]></payload>
<payload_hash>-763428169</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">0b46e39447b4c2101e4bf2b4116d436a</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>8f46e39447b4c2101e4bf2b4116d436a</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e067456fa0000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table/>
<target_name>evt_mgmt.alert_reopens_incident_state</target_name>
<type>System Property</type>
<update_domain>global</update_domain>
<update_guid>36252358b1b4c210eb5ca777662631cc</update_guid>
<update_guid_history>36252358b1b4c210eb5ca777662631cc:-763428169,fd7ff7436d900e10e0458faa816a3d59:-763428169,2a88655644184610f7396d334b3be55f:-763428169,7643651a3ed4461087fa8e3c59b91c12:487019009</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_script_9944b59a2f1846104cc5dc1a2799b6c4</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update sys_domain="global" table="sys_script"><sys_script action="INSERT_OR_UPDATE"><abort_action>false</abort_action><access>package_private</access><action_delete>false</action_delete><action_insert>false</action_insert><action_query>false</action_query><action_update>true</action_update><active>false</active><add_message>false</add_message><advanced>true</advanced><change_fields>false</change_fields><client_callable>false</client_callable><collection>em_alert</collection><condition>((previous.state == 'Closed' &amp;&amp; (current.state == 'Reopen' || current.state == 'Flapping')) || (previous.severity == '5' &amp;&amp; current.severity != '5' &amp;&amp; current.severity != '0')) &amp;&amp; ((!current.incident.nil()) || (!current.remote_task_id.nil()) )</condition><description/><execute_function>false</execute_function><filter_condition/><is_rest>false</is_rest><message/><name>EMP Reopen associated closed incident</name><order>500</order><priority>100</priority><rest_method/><rest_method_text/><rest_service/><rest_service_text/><rest_variables/><role_conditions/><script><![CDATA[(function executeRule(current, previous /*null when async*/) {
// This rule runs when a closed alert is reopened or goes into flapping for a new event
// It checks if the associated task is in the resolved or closed state
// If it is, then it can reopen that task or create a new one (checks the property alert_reopens_incident)
// If not, it just adds a comment on the task
var alertManager = new SNC.AlertManager();
alertManager.addStep("Alert BR: Reopen associated closed incident (after)");
var alertManagementAlertReopenHandlerDynamic;
if (EvtMgmtAlertMgmtProperties.isARMScopedAppActive())
{
gs.include('sn_em_arm.EmpEvtMgmtAlertMgmtAlertReopenHandler');
alertManagementAlertReopenHandlerDynamic = new sn_em_arm.EmpEvtMgmtAlertMgmtAlertReopenHandler();
}
else
{
gs.include('EmpEvtMgmtAlertManagementAlertReopenHandler');
alertManagementAlertReopenHandlerDynamic = new EmpEvtMgmtAlertManagementAlertReopenHandler();
}
alertManagementAlertReopenHandlerDynamic.onAlertReopen(current);
})(current, previous);
]]></script><sys_class_name>sys_script</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-02-13 23:02:25</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>9944b59a2f1846104cc5dc1a2799b6c4</sys_id><sys_mod_count>5</sys_mod_count><sys_name>EMP Reopen associated closed incident</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_script_9944b59a2f1846104cc5dc1a2799b6c4</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-03-03 22:26:01</sys_updated_on><template/><when>after</when></sys_script><sys_translated_text action="delete_multiple" query="documentkey=9944b59a2f1846104cc5dc1a2799b6c4"/></record_update></payload>
<payload_hash>-2089304892</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">0b46e39447b4c2101e4bf2b4116d436a</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>c746e39447b4c2101e4bf2b4116d436b</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e06766f350000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table>em_alert</table>
<target_name>EMP Reopen associated closed incident</target_name>
<type>Business Rule</type>
<update_domain>global</update_domain>
<update_guid>d0b52798b5b4c21059912ada9cf695da</update_guid>
<update_guid_history>d0b52798b5b4c21059912ada9cf695da:-2089304892,9633af54e9b4c210e3aa9377c9292877:-2089304892,88b51dbbfe64c210713715af3b486c62:1646404427,2aaf3383ef900e10629388cea498d6a2:-2089304892,c2dd73cf9e500e107987c6c40208c265:-2089304892,8da8f62207dcc6104db32638cd400820:1646404427,d8a7f56a19d4c61022d1b9add4f65efc:244033821,a655315eb258461082db97330d39526d:-1006826410</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Global">global</application>
<category>customer</category>
<comments/>
<name>sys_properties_9c2a09d047f082101e4bf2b4116d43f5</name>
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_properties"><sys_properties action="INSERT_OR_UPDATE"><choices/><description>Close/resolution notes for incidents linked to alerts. "{0}" will be replaced with the alert id.</description><ignore_cache>true</ignore_cache><is_private>false</is_private><name>evt_mgmt.alert_incident_close_notes</name><read_roles/><suffix/><sys_class_name>sys_properties</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-03-03 11:17:34</sys_created_on><sys_id>9c2a09d047f082101e4bf2b4116d43f5</sys_id><sys_mod_count>1</sys_mod_count><sys_name>evt_mgmt.alert_incident_close_notes</sys_name><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_properties_9c2a09d047f082101e4bf2b4116d43f5</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-03-03 15:51:37</sys_updated_on><type>string</type><value>Closed the task associated with alert: {0}</value><write_roles/></sys_properties><sys_translated_text action="delete_multiple" query="documentkey=9c2a09d047f082101e4bf2b4116d43f5"/></record_update>]]></payload>
<payload_hash>-569797623</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">0b46e39447b4c2101e4bf2b4116d436a</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>cb46e39447b4c2101e4bf2b4116d436a</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e067456d90000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table/>
<target_name>evt_mgmt.alert_incident_close_notes</target_name>
<type>System Property</type>
<update_domain>global</update_domain>
<update_guid>b6252358b1b4c210a2fc3f05f4f390ca</update_guid>
<update_guid_history>b6252358b1b4c210a2fc3f05f4f390ca:-569797623,85f846d8a0b88210571f25088587b6db:-569797623,ea3a8dd0e9f08210a5a7ebc61deedb44:-1878901701</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
<sys_update_xml action="INSERT_OR_UPDATE">
<action>INSERT_OR_UPDATE</action>
<application display_value="Alert Rules Management">31a0b01e1b706890591141d9bc4bcb31</application>
<category>customer</category>
<comments/>
<name>sys_script_include_8ebf21662f94c6104cc5dc1a2799b676</name>
<payload><?xml version="1.0" encoding="UTF-8"?><record_update table="sys_script_include"><sys_script_include action="INSERT_OR_UPDATE"><access>public</access><active>true</active><api_name>sn_em_arm.EmpEvtMgmtAlertMgmtAlertReopenHandler</api_name><caller_access/><client_callable>false</client_callable><description/><name>EmpEvtMgmtAlertMgmtAlertReopenHandler</name><script><![CDATA[gs.include('EvtMgmtAlertMgmtAlertReopenHandler');
var EmpEvtMgmtAlertMgmtAlertReopenHandler = Class.create();
EmpEvtMgmtAlertMgmtAlertReopenHandler.prototype = Object.extendsObject(EvtMgmtAlertMgmtAlertReopenHandler, {
onAlertReopen: function(current)
{
try
{
var additionalInfo = JSON.parse(current.additional_info);
}
catch (err)
{
gs.error('EMP - Unable to parse "additional_info" field for {0}.', current.number);
}
var alertNumber = current.number;
var task = new GlideRecord('task');
task.get(current.incident);
// Only handle incident tasks. Lines 28-52 in the OOB script appear to choose a state for task types other than
// "incident". We only care about linked incident tasks so that block was not used here.
if (task.sys_class_name == 'incident')
{
var taskNumber = task.number;
var taskState = task.state;
if (taskState == global.IncidentState.RESOLVED || taskState == global.IncidentState.CLOSED)
{
var behaviour;
if (additionalInfo.override_alert_reopens_incident !== undefined)
{
// use the "override" manual attribute configured in an Event Rule
behaviour = additionalInfo.override_alert_reopens_incident;
}
else
{
behaviour = gs.getProperty('evt_mgmt.alert_reopens_incident');
}
var manualIncident = this.incidentCreatedManually(task);
if (behaviour == 'reopen')
{
this.handleReopen(current, alertNumber, manualIncident, taskNumber, task);
}
else if (behaviour == 'new')
{
this.handleNew(current, alertNumber, manualIncident, task.sys_class_name, task, taskNumber);
}
else if (behaviour == 'nothing')
{
// do nothing
}
}
else
{
// incident is still open, just add a comment to it
this.updateWorkNoteField(task, gs.getMessage('The related alert {0} state is now {1}', [alertNumber, current.state]));
task.update();
}
}
else
{
gs.error('EMP - Unable to update {0} linked to {1}, unexpected task type ({2}).',
task.number, current.number, task.sys_class_name);
}
},
reopen: function(current, taskNumber, task)
{
try
{
var additionalInfo = JSON.parse(current.additional_info);
}
catch (err)
{
gs.error('EMP - Unable to parse "additional_info" field for {0}.', current.number);
}
var incidentState;
if (additionalInfo.override_alert_reopens_incident_state !== undefined)
{
// use the "override" manual attribute configured in an Event Rule
incidentState = additionalInfo.override_alert_reopens_incident_state;
}
else
{
incidentState = gs.getProperty('evt_mgmt.alert_reopens_incident_state');
}
switch (incidentState)
{
case 'new':
task.state = global.IncidentState.NEW;
break;
case 'in_progress':
task.state = global.IncidentState.IN_PROGRESS;
break;
case 'on_hold':
task.state = global.IncidentState.ON_HOLD;
break;
default:
task.state = global.IncidentState.NEW;
gs.error(
'EMP - Default state used for {0} linked to {1}, the System Property "evt_mgmt.alert_reopens_incident_state" ' +
'or the Event Rule manual attribute "override_alert_reopens_incident_state" are not set correctly.',
task.number, current.number
);
}
this.updateWorkNoteField(task, gs.getMessage("The related alert {0} state is now {1}", [current.number, current.state]));
task.update();
},
type: 'EmpEvtMgmtAlertMgmtAlertReopenHandler'
});
]]></script><sys_class_name>sys_script_include</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>2024-02-14 17:33:50</sys_created_on><sys_id>8ebf21662f94c6104cc5dc1a2799b676</sys_id><sys_mod_count>0</sys_mod_count><sys_name>EmpEvtMgmtAlertMgmtAlertReopenHandler</sys_name><sys_package display_value="Alert Rules Management" source="sn_em_arm">31a0b01e1b706890591141d9bc4bcb31</sys_package><sys_policy/><sys_scope display_value="Alert Rules Management">31a0b01e1b706890591141d9bc4bcb31</sys_scope><sys_update_name>sys_script_include_8ebf21662f94c6104cc5dc1a2799b676</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>2024-02-14 17:33:50</sys_updated_on></sys_script_include></record_update></payload>
<payload_hash>-600957155</payload_hash>
<remote_update_set display_value="Event Management Plus - Batch Child">3e46e39447b4c2101e4bf2b4116d4369</remote_update_set>
<replace_on_upgrade>false</replace_on_upgrade>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-03-03 22:39:26</sys_created_on>
<sys_id>fe46e39447b4c2101e4bf2b4116d4369</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_recorded_at>18e067748050000001</sys_recorded_at>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-03-03 22:39:26</sys_updated_on>
<table/>
<target_name>EmpEvtMgmtAlertMgmtAlertReopenHandler</target_name>
<type>Script Include</type>
<update_domain>global</update_domain>
<update_guid>02e5e7d86ab4c210344b881129f390a6</update_guid>
<update_guid_history>02e5e7d86ab4c210344b881129f390a6:-600957155,3adfff43db900e106af891be023c4cff:-600957155,83b3b522b4d4c610afe746c311d68994:-600957155</update_guid_history>
<update_set display_value=""/>
<view/>
</sys_update_xml>
</unload>