Setting Event Management Threshold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 07:43 PM
I have a requirement where I need to not create an Alert for the same node if I get a Clear from it within 10 minutes. So for example I receive an Event for Node1 at 10:23:00 with Severity as Major. Then at 10:25:00, I receive another Event from Node1 with Severity as Clear. How do I set Threshold so it doesn't create an Alert but only creates it if the Event came in at 10:33:00 or after for the same Node.
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 11:34 PM
Hi @Looper23,
You can do this in many ways, how do you get the event? via email, API call?
As per my suggestion, you can use the sys_created_on field to compare with the current time and see if it passes the 10 mins. If yes, then you can create/reopen a task or update/skip the existing one.
var currentTime = new GlideDateTime(); // current datetime
var createdOn = new GlideDateTime(gr.getValue("sys_created_on")); // convert sys_created_on to datetime datatype
createdOn.addSeconds(600); // add 10 minutes i.e. 600 seconds
var diff = parseInt(gs.dateDiff(currentTime, createdOn, true)); //compare two times
if(diff > 600){ // check if the time duration is less than 10 mins
//create/reopen
}
else{
//update the existing one
}
Regards,
Snehangshu Sarkar
Please mark an appropriate response as correct if my answer replied to your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2022 12:21 PM
Is this supposed to be a Business Rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 08:26 PM
@Looper23 did you manage to find a solution for this ?