- 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 02:53 AM
Following script will find occurrences of the string in tables.
var searchString = '<string to search>'; // class or method name
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'];
tableList.forEach(searchText);
function searchText(tableName) {
gs.info(tableName + '*************************');
var gr = new GlideRecord(tableName);
gr.addQuery('IR_AND_OR_QUERY', searchString);
gr.query();
while (gr.next()) {
gs.info(tableName + ':' + gr.name);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:33 AM
To find all tables in ServiceNow that has field named "script", search sys_documentation table. Add the table that need to be searched in the array.
For example, Workflow Activity Definition table (wf_activity_definition)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2020 03:56 AM
Sorry, I'm actually not using workflow so that's why it wasn't included in my script. It's probably better to create a new question to find tables name to get other people to reply and also because it's diverting from the original question.
If using Studio, it's also possible to save resource to github and use grep to search. I think this is the best way to manage code and version. Unfortunately can't do this with existing resources and not applicable to the current question.