Feature/identify inactive assignment groups#2626
Feature/identify inactive assignment groups#2626anjimuvva wants to merge 7 commits intoServiceNowDevProgram:mainfrom
Conversation
mskoddow
left a comment
There was a problem hiding this comment.
This script is pretty inefficient and does not follow best practices, like
- iterating all user groups and firing the same query on sys_user_grmember over and over again
- usage of grp.sys_id
- usage of hasNext() without setting the query limit to 1
|
updated my code to reduce iteration calls. |
|
Sorry, I cannot see the value of such an approach as you can already query empty user groups in one go: You just need to leverage so-called related list conditions. In that case the encoded query for your scenario is: active=true^RLQUERYsys_user_grmember.group,=0,m2m^user.active=true^ENDRLQUERY Use that encoded query with the help of SN Utils in the list view of the sys_user_group table! |
PR Description:
This ServiceNow background script identifies assignment groups that have no active members.
Such groups can cause issues with incident routing, task assignment, or notification delivery, since tickets assigned to these groups may never reach an active user.
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions