- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 12:56 AM
I would like to know how to find scripts which call a script include. It could be a CS, BR, Workflow, Flow etc.
I have been asked to modify the script include but also requested me to share the impact and usage of the script across the platform. This is a custom script include developed by somebody else few years back.
I am sure you might have come across this situation. Please help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 01:20 AM
I could think of these
here are the common Scripts
https://docs.servicenow.com/bundle/paris-application-development/page/script/general-scripting/refer...
1) Client Side
Client Scripts
UI Policy
UI Scripts
Catalog Client Script
Catalog UI Policy
Widget client script
UI Pages - Client script
2) Server Side
Business rule
Script include
Script action
Schedule job
Fix Scripts
Workflow run script
Email Scripts
Installation Exits
Widget server side script
ACL Script
Transform map scripts
Field map scripts
UI Actions
UI Pages - Processing script
UI Macros
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 04:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 06:50 AM
Since the question is about finding reference to script include in scripts, add also wf_activity table to the list.
EDIT: As I've mentioned before, try adding all the tables listed in sys_documentation table to find all occurrences in ServiceNow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 09:03 PM
As requested.
The script searches for a string so for example in the following Run Workflow script, I'll search for string 'Item Designer - generate approvals for current sequence' used in scripts.
Script
var searchString = 'Item Designer - generate approvals for current sequence';
var tableList = ['sys_script_client','sys_ui_policy','sys_ui_script','catalog_ui_policy','sys_widgets','sys_ui_page',
'sys_script','sys_script_include','sysevent_script_action','sysauto','sys_script_fix',
'sys_script_email','sys_installation_exit','sp_widget','sys_security_acl','sys_transform_script',
'sys_transform_entry','sys_ui_action','sys_ui_page','sys_ui_macro','sys_ws_definition','sys_script_validator',
'sys_variable_value'];
tableList.forEach(searchText);
function searchText(tableName) {
gs.info(tableName + '*************************');
var gr = new GlideRecord(tableName);
if (tableName != 'sys_variable_value') {
gr.addQuery('IR_AND_OR_QUERY', searchString);
gr.query();
while (gr.next()) {
gs.info('####:' + tableName + ':' + gr.name);
}
} else {
gr.addEncodedQuery('valueLIKE' + searchString);
gr.query();
while (gr.next()) {
gs.info('####:' + tableName + ':' + gr.document + ",id:" + gr.document_key + ",value:" + gr.value);
}
}
}
Screenshot of background script that I ran
Execution output:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:09 AM
Hi - Did you tried code search in studio? You can search by script include name and It will give you all the occurences of script include.
https://community.servicenow.com/community?id=community_blog&sys_id=136caea1dbd0dbc01dcaf3231f96198a
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:13 AM
Code search only searches these tables:
- Access Control
- Business Rule
- Client Script
- Email Template
- Inbound Email Action
- Map Page
- Notification
- Processor
- Relationship
- Scheduled Script Execution
- Script Action
- Script Include
- Style
- Table Transform Map
- UI Action
- UI Macro
- UI Page
- UI Policy
- UI Script