GroupingProduceGroupMainAlertHook - script include not working as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi ,
I have referred the documentation :
and configured the script accordingly in a way to return the oldest alert created as main alert for tag based clustering , but still its not accepting my change as grouping logic and following tag based clustering's grouping logic that is
alert 1
alert 2
alert 3 (created on its own and alert 1 ,2 will become 3's child)
below is the script i used :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
25m ago
Hi @sgchandran
Return the alert's sys_id string instead of the full GlideRecord object.
When getMainAlert receives an object, the platform ignores it and falls back to its default tag-based clustering logic.
- Before: return gr; (GlideRecord)
- After: return grAlert.getValue('sys_id'); (String)
var GroupingProduceGroupMainAlertHook = Class.create();
GroupingProduceGroupMainAlertHook.prototype = {
initialize: function() {},
getMainAlert: function(groupAlertIDs) {
var alertSysId = "";
var grAlert = null;
return !groupAlertIDs ? "" : (function() {
grAlert = new GlideRecord('em_alert');
grAlert.addQuery('sys_id', 'IN', groupAlertIDs);
grAlert.orderBy('sys_created_on');
grAlert.setLimit(1);
grAlert.query();
return grAlert.next() ? grAlert.getValue('sys_id') : "";
})();
},
type: 'GroupingProduceGroupMainAlertHook'
};
This helps other users find accurate and useful information more easily