
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2020 04:17 PM
Hello,
I'm scripting a Scheduled Job.
To get a query, I tried using the condition builder to show records where Service End date field is exactly 60 days from today--then copy the query. I saw posts stating to use the Relative operator. It mentioned using 'on or after'. I do not see 'on or after' as a choice.
I then tried using this query:
service_endRELATIVEEE@days@ago@-60
It works, but not the way I expected. It found for records with a Service End within 60 days from now.
Desmo
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2020 04:24 PM
I have scheduled job to send email to users who's password will expire in next 30 days.
I do something like below
var Days = gs.daysAgoStart(-30).split(' ');
var gr = new GlideRecord('sys_user');
gr.addQuery('u_pwd_expires', 'CONTAINS', Days[0]);
gr.query();
while (gr.next()) {
gs.eventQueue('password.expire.reminder', gr, gr.u_pwd_expires, gs.now());
}
You can do something like that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-29-2020 04:24 PM
I have scheduled job to send email to users who's password will expire in next 30 days.
I do something like below
var Days = gs.daysAgoStart(-30).split(' ');
var gr = new GlideRecord('sys_user');
gr.addQuery('u_pwd_expires', 'CONTAINS', Days[0]);
gr.query();
while (gr.next()) {
gs.eventQueue('password.expire.reminder', gr, gr.u_pwd_expires, gs.now());
}
You can do something like that