Disable a function of a script include

Kelvin-KenA2855
Tera Contributor

If an email is marked by the sender in their email client as sensitive, or the word private is used in the subject then Support Services (scoped application) picks this up and marks the Support Request as private. This is done by this._determinePrivacy() function in a script include. The client has asked if this could be disabled. I have searched and found this function. Suggestions I found asked I search for the BR or Inbound action that calls the function and disable it, however I could not find any. What is the best way to disable this function? 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Kelvin-KenA2855 

let the function be there.

Simply comment the code which calls that

how is that function called?

Since it starts with _ so it is a private function defined and called within the same script include.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

SasiChanthati
Giga Guru
The best and safest way to disable this functionality would be one of the following approaches:
 
Option 1: Customize the Script Include. If the `_determinePrivacy()` method is inside a Script Include you can clone the Script Include (if it’s not read-only), and either comment out the part that checks for "private" and sensitive flags or modify the logic so it always returns `false` or ignores the condition. Then, adjust the references to use your modified version if needed. However, modifying OOTB (out-of-the-box) or Support Services code directly should be done carefully and preferably with a copy.
 
Option 2: Add a system property check inside `_determinePrivacy()`.  A cleaner, upgrade-safe method would be to introduce a system property (e.g., `support_services.skip_privacy_detection`). Update the `_determinePrivacy()` function to check the value of this property first. If it’s set to true, the function can just return without marking the Support Request as private. This way, you don't remove the function, you simply bypass its behavior through configuration, making upgrades much easier in the future.
 
Option 3: Overwrite using Extension Script Includes. If Support Services is designed to allow extension (i.e., they provide extension points), you might be able to extend the class and override the `_determinePrivacy()` method in a child Script Include without modifying the original. This is preferred if the app was designed for extensibility.
Directly disabling the function without understanding where exactly it’s called can be risky.
 
 The best practice is either (1) modify `_determinePrivacy()` carefully with a toggle using a system property, or (2) override the behavior through an extension if possible. Simply disabling an unknown inbound process might not be safe unless you fully trace all usage.

View solution in original post

5 REPLIES 5

SasiChanthati
Giga Guru
The best and safest way to disable this functionality would be one of the following approaches:
 
Option 1: Customize the Script Include. If the `_determinePrivacy()` method is inside a Script Include you can clone the Script Include (if it’s not read-only), and either comment out the part that checks for "private" and sensitive flags or modify the logic so it always returns `false` or ignores the condition. Then, adjust the references to use your modified version if needed. However, modifying OOTB (out-of-the-box) or Support Services code directly should be done carefully and preferably with a copy.
 
Option 2: Add a system property check inside `_determinePrivacy()`.  A cleaner, upgrade-safe method would be to introduce a system property (e.g., `support_services.skip_privacy_detection`). Update the `_determinePrivacy()` function to check the value of this property first. If it’s set to true, the function can just return without marking the Support Request as private. This way, you don't remove the function, you simply bypass its behavior through configuration, making upgrades much easier in the future.
 
Option 3: Overwrite using Extension Script Includes. If Support Services is designed to allow extension (i.e., they provide extension points), you might be able to extend the class and override the `_determinePrivacy()` method in a child Script Include without modifying the original. This is preferred if the app was designed for extensibility.
Directly disabling the function without understanding where exactly it’s called can be risky.
 
 The best practice is either (1) modify `_determinePrivacy()` carefully with a toggle using a system property, or (2) override the behavior through an extension if possible. Simply disabling an unknown inbound process might not be safe unless you fully trace all usage.