Alert Severity Update Behavior When Reopened by a New Event

Hasini Chukka
Tera Contributor
 

When an Alert is reopened due to a new event being received within the 4-hour window, and the new event has a different severity from the existing Alert, will the Alert's severity be updated to match the new event's severity? If yes, how does this update happen?

 
1 REPLY 1

HasanM
Kilo Sage

Hi @Hasini Chukka 

If the severity isn't updating on reopen, you can sync it from the latest event with a before-update business rule on em_alert:

Table: em_alert
When: before, Update
Condition: current.state.changesTo('Reopen')

(function executeRule(current, previous) {
var ev = new GlideRecord('em_event');
ev.addQuery('message_key', current.message_key);
ev.orderByDesc('sys_created_on');
ev.setLimit(1);
ev.query();
if (ev.next() && ev.severity != current.severity) {
current.severity = ev.severity;
}
})(current, previous);

Test it in a sub-production instance first.

Hope this helps.