Any one it could be possiable throught Events or scheduled job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 08:34 AM
Need to be able to troubleshoot unusual events. We have a situation where periodically consumable transaction are entered at an inhuman rate. We need to write a routine to detect this so we can alert SN support.
--->If there is more than 4 records that are modified at the same time then send a message that the issue is occuring. So if we get 4 records or more on the same day, same hour, same minute, same second from the same userid then this meets the condition.
-->Then when this happens you send us an immedate message within 1 day of the issue so we can access the information on the logs. So send email to our L2 group and we can notify.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2024 08:43 AM
Hi @mastan babu ko1 ,
Not sure on what the ask is here. Can you explain your issue statement more clearly?
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 12:02 AM
If user made any modification more than 4 records on consumer table by same Userid(same person) in same day. If this condition meets, Then we need to send a email to Servicenow instance. In order to check in system logs when they need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 03:11 AM
If user made any modifications more than 4 records on consumer table by same Userid(same person) in same day. If this condition meets, Then we need to send a email to Servicenow instance. In order to check in system logs when they need
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 12:40 AM
Hi @mastanbabuk ,
Still your details are not elaborative, which makes it difficult to understand the ask and help out . Based on so fat what I have understood you want to trigger a notification when the same User updates more than 4 records in consumable table.
I would propose to make use of Scheduled Job here to meet this requirement.
Steps:
1. Create an event by navigating to Registry as shown below:
2. Create a Scheduled Job and use the script shared below:
Please make adjustment as required as per your configurations:
var ga = new GlideAggregate('alm_consumable');
ga.addAggregate('COUNT');
ga.groupBy('sys_updated_by');
ga.addEncodedQuery("sys_updated_onON2024-05-08@javascript:gs.dateGenerate('2024-05-08','start')@javascript:gs.dateGenerate('2024-05-08','end')");
ga.query();
while (ga.next()){
gs.print(ga.getDisplayValue('sys_updated_by') + '|' + ga.getAggregate('COUNT'));
}
if(ga.getAggregate('COUNT') >= 4){
gs.eventQueue('Name of your Event',ga,Parm1, Parm2);
}
3. Configure your notification using this event used in Scheduled Job
Regards,
Shloke