- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-17-2022 05:18 AM
Summary
With the release of Quebec, ServiceNow have removed 3 fields from the fix script table (Active, Run Once, Flush Cache).
As a result (unsure if it’s a direct relationship to the removal of these fields), all fix scripts associated to the application scope are run after an install or upgrade of the scoped application.
This can cause unexpected and undesired effects for developers who have created a fix script with the intention to solve a specific scenario under the right circumstances and only to be run under those.
This means now the mentality of creating fix scripts in scoped applications that will be deployed need to assume they ALL run pre/post install or upgrade.
Side Effect
All fix scripts for the scoped application get run by default (post upgrade), or pre-upgrade if the ‘before’ field is ticked on the fix script.
For some, these changes may not make much of a difference but those who have in the past have created fix scripts with the intention to only be run for specific reasons or conditions (after review) it can be now harmful to upgrade the scoped application without some kind of intervention.
Example Scenario
- Company XYZ 4 years ago created several fix scripts for a scoped application only to run if required post Go-Live depending on the customer wanting to enable a feature or not.
- The fix scripts were marked as inactive and only to be run by the admin if needed as this could have undesired effects if ran without the correct scenario
- Company XYZ then upgrades to Quebec/Rome
- Company XYZ goes through the regular development cycle and finally upgrades the scoped application to the latest version
- The legacy fix scripts from 4 years ago which are no longer relevant all kick off post upgrade of the scoped application
I am interested in hearing how you may want to tackle this moving forward as I feel the severity of this issue is not yet apparent enough and now is about the time companies are moving to Quebec/Rome and will be soon upgrading their various scoped applications unknowing of this behaviour.
Official ServiceNow Documentation on Fix Scripts:
A fix script is server-side JavaScript code that you run after an application is installed or upgraded.
Include fix scripts to make changes that are necessary for the data integrity or product stability of an application.
Review the code design to ensure that it can run more than once on the same system without causing damage. For example, you may write a fix script that adds a role to a property by default. Design the script so that it can run multiple times on the same system without overwriting the existing data, even if it is not necessary to run the script again after the initial installation.
- 2,013 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
Thank you for bringing this change to our attention. I was not aware of the comprehensive consequences.
Kind regards
Maik
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@David H3 Do we know what the official recommendation is for one off scripts that we need to run in a scoped application? Scripts - Background doesn't allow you to run in a scoped app so it seems like it would be a scheduled job but unfortunately that doesn't have the rollback option like a fix script. It's not clear why this change was made but it's definitely frustrating that it's been over a year and there is still no official documentation or guidance on this.