How to stop a scheduled script execution ("On demand")

Stefan Baldhof1
Kilo Guru

Hi,

I created a scheduled script for testing purposes which is run only "On demand". Reason: I don't always want to test long running scripts via "Scripts - Background" as I'm stuck to this until the script finishes. But there's no possibility to stop such scheduled script once it is started - or does anyone know a way to do so?

1 ACCEPTED SOLUTION

Hi Stefan,



Here is what I found in my testing.   This was tested in a Helsinki Developers instance.   Can you please advise on any differences in the steps we are taking or what you are seeing?



1) Created a new Scheduled job with a simple loop to log a number (set the number high enough that I have time to go look before the script finishes):


basicLoop.PNG



2) Execute Now


3) Reviewed the User Administration > All Active Transactions:


Transactions.PNG



5) Killed the transaction


4) Checked the logs and confirmed that the log statements were no longer being generated.



Enjoy!


-Robert


View solution in original post

14 REPLIES 14

User145619
Giga Expert

did you tried killing it from the active transactions. Try inactivating schedulejob aswell.



View and kill active transaction


Can you close the thread and mark as correct solution if you're ok with the solution.


"All active transactions" only shows my own transaction "looking at active transactions" (/v_transaction_list.do), but not the script running. What do you mean with "inactivating schedulejob"? The "Scheduled" Script is run "On demand"!


Robert Chrystie
ServiceNow Employee
ServiceNow Employee

Hi Stefan,



You should be able to see your script running by navigating to User Administration > All Active Transactions.   There should be a record there with a URL that starts with 'System Trigger'.   From here you can check the box next to that record, and select Kill from the list actions.



Enjoy!


-Robert