How to know a script is OOB from servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 05:54 AM
We are trying to avoid changes to OOB scripts without an approval or only a specific group members will be allowed to make changes and developing a POC around it
Question :
How can we identify/query all scripts whether they are OOB or not.
example for business rule i need to get all OOB scripts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 06:01 AM
Hi,
There's not an official "checkbox" or something easy to see if script or business rule, etc. was out of box, but there are definitely a few "signs".
-You can look at the created date (the created date for out of box scripts, etc. tend to be years ago most likely before your client/company started to use SN, so that's an obvious sign)
-You can look at the created by (most will say 'admin' or even other names of people who aren't within your org -- so actual SN individuals)
-You can look at the versions related list (if not available, try and see if you can add the versions related list to the record you're looking at, that versions list will show you if it was altered from base)
Here's a community thread with some other tips as well: https://community.servicenow.com/community?id=community_question&sys_id=f64047a1db98dbc01dcaf3231f96...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 06:08 AM
Hi there,
You can use SncAppFiles.hasCustomerUpdate to check. For example below code, where I check if a certain Fix Script (sys_script_fix) is out-of-the-box or not. The sys_id obviously of the Fix Script.
var gr = new GlideRecord('sys_script_fix');
gr.get('320d43ea532010109c22ddeeff7b128d');
var x = !SncAppFiles.hasCustomerUpdate(gr);
gs.info(x);
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 06:30 AM
Hi Kiddy,
You can check sys_update_xml table to know which records are updated or created by the dev's. The records which not in the list are still using OOB versins.
Below script can give you the list of Business Rules which are updated by the users.
var cust_updates = new GlideRecord('sys_update_xml');
var br_sysID = [];
cust_updates.addQuery('type','Business Rules');
cust_updates.query();
while(cust_updates.next()){
var sysid = cust_updates.name.split('script_')[1];
br_sysID.push(sysid);
}
var br = new GlideRecord('sys_script'); //name business rule table
br.addEncodedQuery('sys_idIN'+br_sysID.toString());
br.query();
while(br.next()){
//list of BR's updated and no more OOB now
//other than this list, all BR's are OOB
}
you can change table names to get different type of script list
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2020 06:42 AM
Check "Updated" and "Updated by" columns. OOTB scripts are all on the same date and times are usually near. If a script is modified, updated will contain newer date.
"Created" will have the date/time when the script was created but it won't catch if the OOTB script is modified.
If these columns are not appearing, add them to the list using the following steps.
- Select the gear icon
- Move "Updated" and "Updated by" items from left to right
OOTB scripts are all on the same date and time.