Event and notification is not triggering from the scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 06:02 AM
Hello All,
I am facing issue with the scheduled job which is not triggering the Event and notification is not sending. The same script is Working fine from the Background Script. I don't know if it is any setting or not but 'gs.log' is also not printing from the scheduled job. I also tried making Notification, scheduled job, Event, Script include in same scoped application but it is still not working. Note: before making the script include also tried with direct logic written in Scheduled job.
Any suggestion would be great help.
Scheduled Job:
Script Include:
Event:
Notification:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 05:16 AM
I think use of date fields should be used to leverage glidedatetime, you don't need gs.nowdatetime and I think it doesn't even work in scoped apps.
Also, how are you calling the script inc?
Just put a simple hello at the top, to check if anything is going through
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 05:30 AM
Like I said don't know why but log is not printing in this instance(only from Job). but to check if the job is running or not, I write small code to change the description of 1 incident record and it is updating that record successfully , In that script also log is not printed.
what can be used instead of gs.nowdatetime?
Scheduled job call:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 03:56 AM
Hi Ram,
gs.log() does not work in scoped application, can you add gs.info() and check if the schedule jobs is being triggered correctly?
Is the event being triggered in event log?
Regards,
Deepankar Mathur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 04:32 AM
Yes, Understand this point while testing simple logic of incident desc. change in same script include.
No, Not triggering from 'Scheduled job' but event log is triggering from 'background script' with same script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2022 04:00 AM
Hi,
gs.info() is to be used in scoped app.
If you use gs.log() your script will break
Did you check your job was picked up by scheduler or not?
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader