How to find scripts which call a script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 05:28 PM
Hi,
I would like to know how to find scripts which call a script include.
I have to change the script include for a reason but I need to check if there is any script calling it which I don't know.
Best Regards,
Kohei
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 05:43 PM
Hi, Studio has a code search function which may be helpfull.
Otherwise you can manually search the script field intables directly, but there are a lot of places a script include function can be called - hopefully your knowledge of the platform will allow you to exclude some of the possible usage

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 06:21 PM
If the script include is only used in some certain type of script like Catalog Client Scripts, just search display the list and use the "for text" search.
For example, following steps will find all occurrence of "GetUserInfo" in Catalog Client Scripts.
- Open "Service Catalog" > Catalog Client Scripts"
- Search on "for text" for "GetuserInfo".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 06:41 PM
Can also execute following script to search on client script, scripted REST API, script include.
var searchString = 'GetUserInfo'; // string to search
var tableList = ['sys_script_client', 'sys_ws_definition', 'sys_script_include'];
tableList.forEach(searchText);
function searchText(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
‎12-02-2024 06:19 AM
I've a question regarding the code snippet you write
what's 'IR_AND_OR_QUERY' and how does it works in the code