Skip to content

Commit f16a8d2

Browse files
koratalasadminniamccash
authored
Check for Orphaned tickets (#130)
* Check for tickets without assignment group * Update README.md * Instead of using GlideRecord unnecessarily, made use of the table filters. This has improved the efficiency and optimized the run time as well. --------- Co-authored-by: admin <[email protected]> Co-authored-by: niamccash <[email protected]>
1 parent 3b80700 commit f16a8d2

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ During the time it can be a situation that person is no longer active in the sys
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

149149
### 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 not be left blank.
151-
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.
152151

153152
## Category: Upgradability
154153

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
NphMlwVg49IDN_AmbhZA_S2n4C2Ak0kx2FHZhxUGSGGxUbqgZMunGHiqZzRmFpvjBevGWNbaflHkL2XtSDBN4OyJbkF2BqC_swBzwqMIAVV449V_huL8FUWbgEpPvhHD2uyLtmpJR4q4WfEjJzmjWQnXFksmQtAHDFZp7M4XpWRfyFc_r05eE9u10khR0-YcO18-wKcYnWt4sJGYiyZhzioxcrb_D8yHEfrX6CAJUaQUy79-ADc9GNx6LJSw9MdryaoB1idOH2U5-FRpcwwxHmY2AxV7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eE

ca8467c41b9abc10ce0f62c3b24bcbaa/update/scan_table_check_7334dda283455210ae0854b6feaad378.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<active>true</active>
44
<advanced>true</advanced>
55
<category>manageability</category>
6-
<conditions table="incident">active=true^EQ<item endquery="false" field="active" goto="false" newquery="false" operator="=" or="false" value="true"/>
6+
<conditions table="incident">active=true^assignment_group=^EQ<item endquery="false" field="active" goto="false" newquery="false" operator="=" or="false" value="true"/>
7+
<item endquery="false" field="assignment_group" goto="false" newquery="false" operator="=" or="false" value=""/>
78
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
89
</conditions>
910
<description>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.</description>
@@ -17,27 +18,30 @@
1718
<score_min>0</score_min>
1819
<score_scale>1</score_scale>
1920
<script><![CDATA[(function(finding, current) {
20-
var IncID = current.getValue('sys_id');
21-
var inc = new GlideRecord('incident');
22-
inc.addQuery('sys_id', IncID);
23-
inc.addEncodedQuery("assignment_group!=null");
24-
if (!inc.hasNext()) {
25-
finding.increment();
26-
}
21+
//var IncID = current.getValue('sys_id');
22+
// var inc = new GlideRecord('incident');
23+
// inc.addQuery('sys_id', IncID);
24+
// inc.addEncodedQuery("assignment_group!=null");
25+
// if (!inc.hasNext()) {
26+
// finding.increment();
27+
// }
28+
//if(current.assignment_group!=null){
29+
finding.increment();
30+
//}
2731
})(finding, current);]]></script>
2832
<short_description>Tickets from Incident table should have assignment group specified.</short_description>
2933
<sys_class_name>scan_table_check</sys_class_name>
3034
<sys_created_by>admin</sys_created_by>
3135
<sys_created_on>2024-10-07 18:22:05</sys_created_on>
3236
<sys_id>7334dda283455210ae0854b6feaad378</sys_id>
33-
<sys_mod_count>9</sys_mod_count>
37+
<sys_mod_count>12</sys_mod_count>
3438
<sys_name>Check for Orphaned tickets</sys_name>
3539
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
3640
<sys_policy/>
3741
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
3842
<sys_update_name>scan_table_check_7334dda283455210ae0854b6feaad378</sys_update_name>
3943
<sys_updated_by>admin</sys_updated_by>
40-
<sys_updated_on>2024-10-07 18:33:38</sys_updated_on>
44+
<sys_updated_on>2024-10-09 06:30:13</sys_updated_on>
4145
<table>incident</table>
4246
<use_manifest>false</use_manifest>
4347
</scan_table_check>

0 commit comments

Comments
 (0)