Fix Script or On Demand Scheduled Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 08:30 AM
I need some explanation as to when to create a script as a Fix Script and when to create it as an On Demand Scheduled Script.
My team and I sometimes create scripts to update data within our instance that was not updated automatically when it should have been. For example, we have a script that will close open catalog tasks in which we specify the #'s for that did not closed for some reason or another. Another example is that we have a script that will close change requests that we specify the #'s for if the change tasks are closed. We also have others. My question that I'd like an explanation for is what should these scripts be created as: Fix Scripts OR On Demand Scheduled Scripts?
The name, Fix Script, sounds like it would include the types of scripts mentioned but ServiceNow documentation states "A fix script is server-side JavaScript code that you run after an application is installed or upgraded" which doesn't quite fit our examples.
The name, Schedule Script, doesn't sound like it would include the types of scripts mentioned but the fact that it can be set to run 'On Demand' makes me think that maybe the example scripts mentioned should be created as Scheduled Scripts.
When should I create my script as a Fix Script and when should I create it as an On Demand Scheduled Script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 08:45 AM
From my opinion Fix script can be used when we want to do a one time cleanup which will not occur again(For example: updating the choice of field from invalid value(created by mistake) to valid value).
On Demand scheduled job should be used when we feel the script can be used in future and not needed to run regularly. (for example closing the active sla's of inactive task which are missed to close somehow)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 08:56 AM - edited 05-22-2025 08:58 AM
Hi @Jim Tandy ,
Technically, both are server side execution entity and how we are using either of them it completely up to need & team's decision.
My approach, for any reason, once i created either of them will not change the code in future for any reason for tracking/audit purpose. Any new requirement will be cater through new script.
So which one we should use, if only one time execution required and part of some release deployment to update data or data fix, I will go for Fix Script, as it will captured in release update set.
And where there is need to recurring execution and keep updating data which fall under same filter condition with out making any change in the script code ( in future ) then I will go with scheduled script which gives us option to schedule the execution.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 09:14 AM
Fix Script: Use when
1) you are releasing an update/application and need to fix some data as part of deployment
2) you want to track the execution history and ensure it runs only once
3) you want the script to package with an update set or application
Scheduled Script: When to use
1) admin need to run script multiple times or adhoc basis to fix something
2) script is not tightly coupled with any application
3) you want to trigger it manually or on schedule basis
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 09:26 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader