FujiForty - Get Your Fix

Fix scripts aren't really new in Fuji, but with the upcoming launch of the app store driving more vendors to publish applications it's worth pointing out why they exist.

ServiceNow developers frequently uses fix scripts in core and optional plugins. They are used when an application developer needs to perform some custom logic before or after an application is installed or upgraded. 

While there is an option to run a fix script every time an application is installed and upgraded, the most common uses are single execution only. This is controlled through the "Run once" field. Scripts can be set to execute "Before" your application is installed/upgraded, or after depending on your requirements.

When the script is executed during an application install or upgrade it is running in the context of your application scope so it will have access to all of the scope data. Access to out-of-scope data may be limited depending on access control just as any other app processing.

Customers can rerun fix scripts that you deployed via the "Run Fix Script" UI Action. This is not a common practice and I can't think of any cases that I've seen it used. It's important to note that when the script is evaluated using this manual method the script is executed in the global scope, not the application scope, so the results may not be as expected.