Rename any script include with a duplicate name with a unique name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 09:12 PM
Hi Team,
Does any one have an idea on how we replace duplicate names with script include.
For Example :
Name: msteams i have see this script include twice.
1)How do i fix this.
2)How do i know if this script include is used either in business rule or client script.
Thank You in Advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 09:29 PM
Hi,
Consider the following.
a. Launch "System Applications > Studio"
b. In Studio, select any application
c. Select "Search > Code Search"
d. Enter the search term (Script include name), check "Search in all applications", and click "Search"
This will list all scripts that reference the Script include.
Please mark the response as correct if this has helped address the issue.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 09:30 PM
Hi,
1) You can do a code search to find the occurrences of script include. It will give you well understanding of where it's been referenced but not all.
2) Try below script given by Hitoshi Ozawa that find all the occurrences of a string.
var searchString = 'msteams'; // 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);
}
}
Hope that helps!
Regards,
Muhammad
Muhammad