- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2019 11:03 PM
Good day All,
I would like to get a notification when the Duplicate Algo administration remains switched off for more than 1 hour.
The notification should be sent to all the users having the 'Duplicate Algo Administration'.
automatic notification after 1 hour and if the algo remains off, again a notification every 30 minutes until its switched on again.
Support team should get this notification
when ever the unchecked the check box and then automatically trigger the notification for every 30mins up to when we click the check box again(means check box is not empty)
Please help me on above requirement. Thanks in-advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2019 09:55 PM
Hi Akash, Good morning
Thanks for your information regarding on my task. process wise OK. But I'm tried below code. NOW it's working fine
var r=new GlideRecord('sys_properties');
r.addQuery('name','Value');
r.addQuery('name','Value');
r.addQuery('value','false');
r.query();
if(r.next())
{
var u=new GlideDateTime(r.sys_updated_on);
var t=new GlideDateTime();
var d=gs.dateDiff(u,t,false);
if(d>='01:00:00'){
var pop= gs.getProperty('sys_property name');
if (pop == 'false'){
var r=new GlideRecord('sys_user');
r.query();
if(r.next())
{
gs.log('New User');
gs.eventQueue('notify_user',r,gs.getUserID(),gs.getUserName() );
}
}
}
}
Regards,
Reddy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2019 01:39 AM
I wouldn't do this through Scheduled Jobs. Conditional Timers are best done through Workflows.
Create a Workflow on the System Property Table.
Condition: Name = <Your property> and Value is true
- Wait 1 hour (Timer activity)
- IF
-
- Value is still true
- Has not been updated in the past hour
- ELSE
-
- Stop workflow
- Wait 30 minutes (Time activity)
- IF
-
- Value is still true
- Has not been updated in the past 30 min
- ELSE
-
- Stop workflow
- Send email
- Go back to "wait 30 minutes"
Was hoping to be able to do this through flow, but you can't put a timer into a loop.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2019 01:45 AM
Hello,
If I consider your case from the initial stage, you need to do the following things:
1. Create a notification if you do not have yet! say - Notify support users and configure all required details on When Who and What
2. Create a event in Event Registry and provide this event name in the above notification step
3. Create a scheduled job and script as shown below to trigger for every 30 mins if the property is inactive
Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2019 01:52 AM
Problem with that would be that the property could be set 1 minute before that scheduled job runs, so users would be getting an email after 1 minute, not 30.
The first one also needs to be an hour.
Alas, I think workflow is the way to go. It is a bit too complex using events and scheduled jobs in my view.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2019 01:57 AM
That's nice! In case the solution doesn't work and before moving to workflows, we can use GlideDate() APIs to verify the 30 min lag, what would you say?
Also, I guess as I am using an If loop to check the property once again before triggering - in the script block, hope this removes the ambiguity.
Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.