Skip to content

Instance scan check for Duplicate Update set names #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ Update sets with more than 1000 configuration updates should be broken down into
### Updates in wrong update set scope
The scope for Customer Update [sys_update_xml] records should match the scope of the Update Set in which the Customer Update resides. Having a mismatch may cause Update Sets to generate preview errors meaning you cannot commit them until the errors are resolved.

## Duplicate Updat Set Name
Maintain unique names for update set names it will help to track the updates easyly and also very useful to debug any issues.

### Delete orphaned variables
Variables should be used in Catalog Item or a Variable Set. Variables not in use should be deleted.

Expand Down
2 changes: 1 addition & 1 deletion ca8467c41b9abc10ce0f62c3b24bcbaa/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
WxlZrk3tCfYVHk_P7E55adKaUW_gqoyy24ppXoe_69vo--9SyJclWjdUy5AQkY5Ap_mxCkrx2gvrGWKEztSmdYjsA4ae2kZovmnl1WpoJUNyffVi867QMODK6SMwn0UNtdRC8gTv1FbwX3v-kAwkwRrMVqITUc0oqJp3zLDHmyYoQM2T6qV-EG4KiSlwyRmP3dlRKdSG6hawJEEI99CCJvY-wukSHzmbPQfH_G8V9yze8DiZjeTqDdJLWYPG35QHA2HBDB1FBoZEWSv9uhCuYKQKyFa-2NK_8Lqa55PApoY6LgwN6iPEY8s4JyUnCO8D0Fghg8o73gjuITnNh9IUu-YLqeEqJ0CTkwot5zocpLIQv-6fxsYmKdhxsxVi_Mq-iK36MqsjC14OJ343BcC8-HmTWhN53mgYYiaemNVl2kfKgi2CwvDLruj-aalscIT1lsxEDt0Eg7OCfEvLo-VnqO2Fhyn1pczEzV06naJgmeeKBJOVOqW2TGe2bHELdkgHlorijjTcgzZqlWRtWTrrsS46nrNrUPOD4Vd456NflTNsyXSuWBPr2thZ4aM77UKfrzWoWpgbCYq8QPt3MTp907h91ovrgQqpqdLWW2M9e8DxQ6iZUv-7r-Aw8uvIMkFSAJvV1UiYZ3nGZiqjxjH6bKTZjRuQ-2MEEy0eeAPEbeY
BgiovevC1ze9ekbSNu313pR_3YPr9xUl8hAleZQ_Rnfiowfr5T_DAmii6h_xnZewjTA5kJDPZ8x14S0gIPG4eStZ_r0uGIAEaMA2i5ojlbIKORDDapgOMutOHKJaSSwf5uZ0VkEcLzooGIDWB0v16daIWWmH_U_tcnLaTE7bj5lyq4EtAk53xdL2hPu7eGFz949_eZIJg4np37S0xRegM9y_dmXRrQ8sLopLNT_af4u_BCPeNIg9Gwq5Wjn9Qj-xbi8bazd-3t7Koe2HKHH2vqOryT-dhuZufc9zUI_l55ev-4cGovoOeBX2wc13EwKh1HIMaW9kwiWljZ-0An9_loh6WU6FYCcnEV9xS2xDXUbHOoWeuOdg76lvyor5qfEN3jOQ46xXIoW5vidkXaoBVtMSLMcBFbrFBZuJWI0Zq4lZU6TiRvzbveuo1rDeAv126QIJhGCuE0SDcvzuV96dbttSOQ-ZgAUumexHi91tJ_97V2MDP9q5Ms-5Y0Mg9r0PNqCibJqaPEnkxgYPIYePZZZdYPYWbOtM4eTteRkWZxAXO_lRTEq7Bon9z0cpiIRBaZLIg7LiMeLZk8F2gHservOdv1_Y1D_rFznoMifC65doHeUJMmIqw6u6vCAM7C9B8YpsXDLWfL6sPrSqTQwVK1WHG_lmjTI_4U6Qb1fAgFg
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>true</advanced>
<category>manageability</category>
<conditions/>
<description>Having two Update Sets with the same name in ServiceNow makes it hard to debug and track changes.</description>
<documentation_url/>
<finding_type>scan_finding</finding_type>
<name>Duplicate Updat Set Name</name>
<priority>3</priority>
<resolution_details>Ensure all your Update sets have unique names. Rename any update set with a duplicate name with a unique name</resolution_details>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function(finding, current) {

// gs.info(current.api_name);
// gs.info('Checking script Include name: ' + current.api_name);
var ga = new GlideAggregate('sys_update_set');
ga.addQuery('name', current.name);
ga.addQuery('sys_id', '!=', current.sys_id);
ga.addAggregate('COUNT');
ga.query();
ga.next();

if (ga.getAggregate('COUNT') >= 1) {
finding.increment();
finding.count = ga.getAggregate('COUNT');
}
})(finding, current);]]></script>
<short_description>Duplicate Updateset Names</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-19 11:29:09</sys_created_on>
<sys_id>b68a2d5ac3111210eb11ba2ed40131fa</sys_id>
<sys_mod_count>2</sys_mod_count>
<sys_name>Duplicate Updat Set Name</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_b68a2d5ac3111210eb11ba2ed40131fa</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-19 11:33:53</sys_updated_on>
<table>sys_update_set</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=b68a2d5ac3111210eb11ba2ed40131fa"/>
<sys_es_latest_script action="INSERT_OR_UPDATE">
<id>b68a2d5ac3111210eb11ba2ed40131fa</id>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2024-10-19 11:32:10</sys_created_on>
<sys_id>033b619ac3111210eb11ba2ed40131d0</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2024-10-19 11:32:10</sys_updated_on>
<table>scan_table_check</table>
<use_es_latest>false</use_es_latest>
</sys_es_latest_script>
</record_update>
Loading