Skip to content

Commit 9e89703

Browse files
authored
Merge branch 'master' into master
2 parents 09c2ac0 + f16a8d2 commit 9e89703

10 files changed

+391
-3
lines changed

README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Variables should be used in Catalog Item or a Variable Set. Variables not in us
100100
### Delete Orphaned Catalog Client Scripts
101101
Catalog Client Script should be used in either a Catalog Item or a Variable Set. Catalog Client Scripts not in use should be deleted.
102102

103-
### Update set description should not be empty
103+
### Delete Orphaned Catalog UI Policies
104104
Catalog UI policy should be used in either a Catalog Item or a Variable Set. Catalog UI Policies not in use should be deleted.
105105

106106
### Client Script Business rule or Script Include should not have an empty description or be without comments in the script section
@@ -146,6 +146,8 @@ During the time it can be a situation that person is no longer active in the sys
146146
### Unsupported API GlideLDAP
147147
GlideLDAP API usage is unsupported by ServiceNow and hence should be avoided, rather use LDAP Server Data Sources to pull data from LDAP via MID Server or directly through an internet facing LDAP.
148148

149+
### Check for Orphaned Tickets
150+
Tickets from tables such as Incident, Change Request, Problem, and other task-related tables should always have an Assignment Group specified. These tickets represent issues or requests that require attention and action. Leaving the Assignment Group field empty can result in unresolved issues or delays in implementing fixes, as no team will be accountable for the resolution. Since the Assignment Group is meant to designate the responsible team for managing these tickets, it should never be left blank.
149151

150152
## Category: Upgradability
151153

@@ -161,6 +163,9 @@ Check if the Choice [sys_choice] table has been extended. This is not supported
161163
### User table should not be extended
162164
Check if the User [sys_user] table has been extended. This is not recommended and can cause problems when a user needs to be in more than one user table.
163165

166+
### Do not reference sys_choice table
167+
The Choice table should not be used as the reference table for a Reference type field. Reference fields store the sys_id of the corresponding record in the reference table and show the specified display value. For example: the caller_id field stores the sys_id of a record from the user table and displays the corresponding name value. This presents a problem when using the sys_choice table, because existing records are deleted and replaced when choices are modified. This causes a new sys_id to be generated for each record in the choice list. So the sys_id stored in the Reference field is no longer a valid value and the reference is broken.
168+
164169
## Category: Performance
165170

166171
### getMessage() called in Client Script
@@ -229,9 +234,21 @@ Restrict the number of row counts ma x to 10,20,50 instead of higher limits such
229234
Navigate to the user preference <sys_user_preference> table and search by 'rowcount'. Set the value to 50 max.
230235
Also, can set the property 'glide.ui.per_page' sys property value to 10, 20, 50 only
231236

232-
### Instance scan check to identify slow jobs in transaction logs.
237+
### Instance scan check to identify slow jobs in transaction logs.
233238
The Instance Scan Check is a table check scan that allows administrators to investigate transaction logs in ServiceNow to diagnose performance issues reported by users. This check specifically identifies transactions with a **Response Time** greater than **120 seconds**, helping to uncover performance bottlenecks, understand user behavior, and track down issues within a specific time frame.
234239

240+
### Check System Property with 'Ignore cache' = False
241+
Ignore Cache is a Glide Properties (records in the sys_properties table) field that impacts system performance.When it’s not handled carefully it can cause a system-wide cache flush leading to potentially severe performance degradation for anywhere from 5 to 30 minutes.
242+
243+
[Ignore cache = False: This will trigger a full cache flush, which might result in performance issues, slowness, and in some cases outage of 5 to 30 mins.]
244+
245+
Select the check box to ignore flushing some server-side caches, thus flushing only the cache for the sys_properties table and preserving the prior property value in all other caches. This option avoids the performance cost of flushing all caches and retrieving new property values. Unless you have some very good reason that the entire system cache needs to be flushed when a Property is changed.
246+
247+
[ Ignore cache = True: An update or insert of a system property will rebuild ONLY for that particular sys_property cache (yes, it is not a full ignore) ]
248+
249+
### Avoid using gs.sleep() in any server-side script
250+
Avoid using gs.sleep() in any script because it does not release session and will cause delays, and add logs to the script whenever gs.sleep() has to be used.
251+
235252
## Category: Security
236253
##Check Mandatory fields on incident
237254
This check is used to find mandatory fields on incident
@@ -291,6 +308,12 @@ Use GlideRecordSecure API to ensure the security checks are performed and unauth
291308
### For loop iterators "i" should be declared
292309
In general, variables in JavaScript should be properly declared (e.g. using “var”). The declaration defines the scope of the variable, ensuring it's accessible only within the intended block. This prevents unintended variable pollution and conflicts. Especially in for loops, often an iterator “i” is used and not properly declared. For example “for (i=0; i<10; i++)” instead of “for (var i=0; i<10; i++)”. As a result, this could unintentionally alter the value of other 'i' iterators in different for loops.
293310

311+
### Don't show unpublished knowledge articles
312+
Unpublished knowledge articles may contain sensitive information that should not be visible to anyone with read access. By preventing access to unpublished articles, reviewers are given the opportunity to verify the content before it is made accessible. This ensures that only properly reviewed and approved information is available to users with read access.
313+
314+
### Scripts in ACLs should be cleared when Advanced is not checked
315+
Scripts in ACLs ARE executed regardless of whether or not the Advanced checked box is checked off. As such, unnecessary scripts should be cleared from the field OR the Advanced checkbox should be checked in cases where scripts are required to provide better visibility to admins for troubleshooting purposes.
316+
294317
## Category: User Experience
295318

296319
### Added a Number Prefix which already exists
@@ -310,6 +333,9 @@ It is recommended to use an OOB library for modals in order to improve the user
310333
### Use "last run datetime" for JDBC data loads
311334
In your JDBC data load configuration, ensure that the 'last run datetime' option is set to true and configure the target database field to serve as a timestamp, as this best practice enables incremental data loading and improves performance in data integration processes using JDBC.
312335

336+
### Use of setWorkflow(false) in business rules will cause unexpected issues
337+
As setWorkflow(false) method will stop the execution of business rules on that particular GlideRecord object, this will result in unexpected behaviour where the execution of business rules skipped. Maintain caution while using this method and perform regression testing to avoid possible risk. It can have noticeable impact on Audit, Journal fields, notifications, SLA engine, workflow, flow engine etc.,
338+
313339
# Additional resources
314340

315341
Please check these additional links for more information and details:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4WWQm_IdWsTxg4URwBle2eXw7sIYuz7QcfROoa5TolyTIo-4kY4yJv9mdj4AV6pxGDqmcce-OqWYk2SRfmXXkpFqgbPUkM2EpKlebMDOKFW2seNgYWN4bkeJ9_Q6L0iEK6I6CR2QT3cGXnUdGOTJcKtOLprLFRIuuxIyn5oIOPoM6Kt1ok5D6usEHVLLSIVKw_2ipwP0u2uEaw_Gik4mla7e-vqKVXeArvB3AyUf6w1x-mRUIYg2ovffLI4ZvhIhdXuo8RFxkzAc5KvSWwMydfQ7Bqnvxc_ZPwwISUEJUshlpVExoEXU4N4ht15P5IrELTHQUYN6qlonJWzWP_kmjEZKO9zpr6yav5-Swp7Rtati5ByQx8sfdfX-MNa1Fg8eAPZUXTQiCiVMIonfzrgDZdUfRWi8kZfN0DnVxS0Drb31u3uroGnsrg4aa5QDU6upUoaX_sUGAdZfoRDxQwU42PA0qu8WKDAwaxdNgsSOy6hFn0rF3BCQkU1aI4aBsx_9P2o58Tp44Xe6IDNO_PuVGIfivJs7DVZzKbHdk4fdc8zRmv2Wl9nwbPpTEKHBDHalqO27RbZGOsB-vUswKKjlEYfgWT5aXoppZaaMI5zvdOvzyE1NsBDSahgAgQBuLSMrK8ZtGILILJn-6gGmh5dZHKbVEzDwrq_H41tkVvlfcJc
1+
WWQm_IdWsTxg4URwBle2eXw7sIYuz7QcfROoa5TolyTIo-4kY4yJv9mdj4AV6pxGDqmcce-OqWYk2SRfmXXkpFqgbPUkM2EpKlebMDOKFW2seNgYWN4bkeJ9_Q6L0iEK6I6CR2QT3cGXnUdGOTJcKtOLprLFRIuuxIyn5oIOPoM6Kt1ok5D6usEHVLLSIVKw_2ipwP0u2uEaw_Gik4mla7e-vqKVXeArvB3AyUf6w1x-mRUIYg2ovffLI4ZvhIhdXuo8RFxkzAc5KvSWwMydfQ7Bqnvxc_ZPwwISUEJUshlpVExoEXU4N4ht15P5IrELTHQUYN6qlonJWzWP_kmjEZKO9zpr6yav5-Swp7Rtati5ByQx8sfdfX-MNa1Fg8eAPZUXTQiCiVMIonfzrgDZdUfRWi8kZfN0DnVxS0Drb31u3uroGnsrg4aa5QDU6upUoaX_sUGAdZfoRDxQwU42PA0qu8WKDAwaxdNgsSOy6hFn0rF3BCQkU1aI4aBsx_9P2o58Tp44Xe6IDNO_PuVGIfivJs7DVZzKbHdk4fdc8zRmv2Wl9nwbPpTEKHBDHalqO27RbZGOsB-vUswKKjlEYfgWT5aXoppZaaMI5zvdOvzyE1NsBDSahgAgQBuLSMrK8ZtGILILJn-6gGmh5dZHKbVEzDwrq_H41tkVvlfcJc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_script_only_check">
2+
<scan_script_only_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<category>security</category>
5+
<description>Unpublished knowledge articles may contain sensitive information that should not be visible to anyone with read access. By preventing access to unpublished articles, reviewers are given the opportunity to verify the content before it is made accessible. This ensures that only properly reviewed and approved information is available to users with read access.</description>
6+
<documentation_url>https://docs.servicenow.com/bundle/vancouver-servicenow-platform/page/product/knowledge-management/reference/r_KnowledgeProperties.html</documentation_url>
7+
<finding_type>scan_finding</finding_type>
8+
<name>Don't show unpublished knowledge articles</name>
9+
<priority>2</priority>
10+
<resolution_details>Set the glide.knowman.show_unpublished property to false.</resolution_details>
11+
<run_condition/>
12+
<score_max>100</score_max>
13+
<score_min>0</score_min>
14+
<score_scale>1</score_scale>
15+
<script><![CDATA[(function(finding) {
16+
var targetProperty = 'glide.knowman.show_unpublished';
17+
var expectedValue = 'false';
18+
var defaultValue = 'true';
19+
20+
var propertyValue = gs.getProperty(targetProperty, defaultValue);
21+
22+
if (propertyValue.toLowerCase() != expectedValue.toLowerCase()) {
23+
var gr = new GlideRecord('sys_properties');
24+
gr.get('name', targetProperty);
25+
finding.setCurrentSource(gr);
26+
finding.increment();
27+
}
28+
})(finding);]]></script>
29+
<short_description>Don't show unpublished knowledge articles</short_description>
30+
<sys_class_name>scan_script_only_check</sys_class_name>
31+
<sys_created_by>daniel.aagren.seehartrai.madsen</sys_created_by>
32+
<sys_created_on>2024-10-03 18:56:04</sys_created_on>
33+
<sys_id>46f6b819834592106137b6cfeeaad352</sys_id>
34+
<sys_mod_count>0</sys_mod_count>
35+
<sys_name>Don't show unpublished knowledge articles</sys_name>
36+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
37+
<sys_policy/>
38+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
39+
<sys_update_name>scan_script_only_check_46f6b819834592106137b6cfeeaad352</sys_update_name>
40+
<sys_updated_by>daniel.aagren.seehartrai.madsen</sys_updated_by>
41+
<sys_updated_on>2024-10-03 18:56:04</sys_updated_on>
42+
</scan_script_only_check>
43+
<sys_translated_text action="delete_multiple" query="documentkey=46f6b819834592106137b6cfeeaad352"/>
44+
<sys_es_latest_script action="INSERT_OR_UPDATE">
45+
<id>46f6b819834592106137b6cfeeaad352</id>
46+
<sys_created_by>daniel.aagren.seehartrai.madsen</sys_created_by>
47+
<sys_created_on>2024-10-03 18:56:04</sys_created_on>
48+
<sys_id>6d677855834592106137b6cfeeaad3d3</sys_id>
49+
<sys_mod_count>0</sys_mod_count>
50+
<sys_updated_by>daniel.aagren.seehartrai.madsen</sys_updated_by>
51+
<sys_updated_on>2024-10-03 18:56:04</sys_updated_on>
52+
<table>scan_script_only_check</table>
53+
<use_es_latest>true</use_es_latest>
54+
</sys_es_latest_script>
55+
</record_update>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>manageability</category>
6+
<conditions table="sys_script">scriptLIKEsetWorklfow(false)^EQ<item endquery="false" field="script" goto="false" newquery="false" operator="LIKE" or="false" value="setWorklfow(false)"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>As setWorkflow(false) method will stop the execution of business rules on that particular GlideRecord object, this will result in unexpected behaviour where the execution of business rules skipped. Maintain caution while using this method and perform regression testing to avoid possible risk. It can have noticeable impact on Audit, Journal fields, notifications, SLA engine, workflow, flow engine etc.,</description>
10+
<documentation_url>https://support.servicenow.com/kb?id=kb_article_view&amp;sysparm_article=KB0867584</documentation_url>
11+
<finding_type>scan_finding</finding_type>
12+
<name>Limit use of setWorkflow(false) in business rules</name>
13+
<priority>2</priority>
14+
<resolution_details>Based on the scenario or use case, think of alternative approach instead of using setWorkflow(false) especially in business rules. Reaserch about the system property trigger_engine.ignore.set_workflow</resolution_details>
15+
<run_condition/>
16+
<score_max>100</score_max>
17+
<score_min>0</score_min>
18+
<score_scale>1</score_scale>
19+
<script><![CDATA[(function (engine) {
20+
21+
// Add your code here
22+
23+
})(engine);]]></script>
24+
<short_description>Use of setWorkflow(false) in business rules will cause unexpected issues</short_description>
25+
<sys_class_name>scan_table_check</sys_class_name>
26+
<sys_created_by>admin</sys_created_by>
27+
<sys_created_on>2024-10-04 15:57:42</sys_created_on>
28+
<sys_id>110515e547819210b8ca0b02d16d4308</sys_id>
29+
<sys_mod_count>1</sys_mod_count>
30+
<sys_name>Limit use of setWorkflow(false) in business rules</sys_name>
31+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
32+
<sys_policy/>
33+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
34+
<sys_update_name>scan_table_check_110515e547819210b8ca0b02d16d4308</sys_update_name>
35+
<sys_updated_by>admin</sys_updated_by>
36+
<sys_updated_on>2024-10-04 16:00:33</sys_updated_on>
37+
<table>sys_script</table>
38+
<use_manifest>false</use_manifest>
39+
</scan_table_check>
40+
<sys_translated_text action="delete_multiple" query="documentkey=110515e547819210b8ca0b02d16d4308"/>
41+
</record_update>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>upgradability</category>
6+
<conditions table="sys_properties">ignore_cache=false^EQ<item endquery="false" field="ignore_cache" goto="false" newquery="false" operator="=" or="false" value="false"/>
7+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
8+
</conditions>
9+
<description>Ignore Cache is a Glide Properties (records in the sys_properties table) field that impacts system performance.When it’s not handled carefully it can cause a system-wide cache flush leading to potentially severe performance degradation for anywhere from 5 to 30 minutes. In some very rare cases, the cache flush can even bring nodes down hard enough that the load balancer takes them offline, thus resulting in temporary session imbalance and causing hours of impact.&#13;
10+
&#13;
11+
[Ignore cache = False: This will trigger a full cache flush, which might result in performance issues, slowness, and in some cases outage of 5 to 30 mins.]</description>
12+
<documentation_url/>
13+
<finding_type>scan_finding</finding_type>
14+
<name>Ignore Cache - System Property</name>
15+
<priority>2</priority>
16+
<resolution_details>Select the check box to ignore flushing some server-side caches, thus flushing only the cache for the sys_properties table and preserving the prior property value in all other caches. This option avoids the performance cost of flushing all caches and retrieving new property values. Unless you have some very good reason that the entire system cache needs to be flushed when a Property is changed&#13;
17+
&#13;
18+
Typically, you should only select the check box and enable ignoring the cache when you have a system property that changes more frequently than once a month.&#13;
19+
&#13;
20+
[ Ignore cache = True: An update or insert of a system property will rebuild ONLY for that particular sys_property cache (yes, it is not a full ignore) ]</resolution_details>
21+
<run_condition/>
22+
<score_max>100</score_max>
23+
<score_min>0</score_min>
24+
<score_scale>1</score_scale>
25+
<script><![CDATA[(function (engine) {
26+
27+
// Add your code here
28+
29+
})(engine);]]></script>
30+
<short_description>Check System Properties as 'Ignroecache' = False </short_description>
31+
<sys_class_name>scan_table_check</sys_class_name>
32+
<sys_created_by>a.pandey</sys_created_by>
33+
<sys_created_on>2024-10-03 14:40:05</sys_created_on>
34+
<sys_id>306c378183c5d2100283b955eeaad3f5</sys_id>
35+
<sys_mod_count>0</sys_mod_count>
36+
<sys_name>Ignore Cache - System Property</sys_name>
37+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
38+
<sys_policy/>
39+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
40+
<sys_update_name>scan_table_check_306c378183c5d2100283b955eeaad3f5</sys_update_name>
41+
<sys_updated_by>a.pandey</sys_updated_by>
42+
<sys_updated_on>2024-10-03 14:40:05</sys_updated_on>
43+
<table>sys_properties</table>
44+
<use_manifest>false</use_manifest>
45+
</scan_table_check>
46+
<sys_translated_text action="delete_multiple" query="documentkey=306c378183c5d2100283b955eeaad3f5"/>
47+
</record_update>

0 commit comments

Comments
 (0)