Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Scheduled Script execution

LJ_23
Tera Contributor

Hello everyone I am trying to create a scheduled job: 

A scheduled job should run and check the end date within the Forescout Pen Test table.

If the end date has passed, the job should set the records to Disposed.

 

this is my script: 

LJ_23_1-1764080634759.png

 

But the status is not updating to disposed?

LJ_23_0-1764080585623.png

 

10 REPLIES 10

Oliver Stammler
Tera Guru

Hey @LJ_23 ,

even though your question has already been answered I just wanted to add one thing real quick.
You should not name your variable "gr" - instead use a "speaking" name to describe what it is as f.e. "grPenTest"

See also this ServiceNow Knowledge Article about this topic: Best Practice: Why using 'gr' as a GlideRecord variable name in custom scripts is always a bad idea

 

Cheers
Oli