Event and notification is not triggering from the scheduled job

Ram156
Mega Expert

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:

find_real_file.png

Script Include:

find_real_file.png

Event:

find_real_file.png

Notification:

find_real_file.png

13 REPLIES 13

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

Best Regards
Aman Kumar

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:

find_real_file.png

dmathur09
Kilo Sage
Kilo Sage

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

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.

Ankur Bawiskar
Tera Patron
Tera Patron

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader