Need Assistance Automating Assignment Group Cleanup in ServiceNow

nameisnani
Mega Sage

Hi Team,

 

I’m looking for guidance on implementing an automated cleanup process for Assignment Groups in ServiceNow. Below are the conditions we need to validate as part of the cleanup activity (to be run quarterly):


Cleanup Conditions Required:

  1. Groups with no members or only inactive members
  2. No tickets (INC, SR, PRB, CHG) assigned in the last 12 months
  3. Groups where associated user records have empty usernames and no last login date
  4. Remove members who have been inactive for more than 12 months
  5. Groups with no members AND no ticket activity in the last 12 months
  6. Additionally, before cleanup, check whether the group is linked to any Application Service based on CMDB/CI records
  7. Retain groups explicitly identified as SUP or APR (these should not be deleted)

Goal:

To build a script or Flow Designer automation that can evaluate the above conditions and help with quarterly assignment group cleanup.

 


Request:

Has anyone implemented similar logic or automated cleanup?
Looking for suggestions on:

  • Best practices
  • Query logic
  • Scripted approach (Business Rule/Scheduled Script)
  • Potential risks
  • Sample scripts or pseudocode

 

IF POSSIBLE, PLEASE ATTACH SCREENSHOTS OF CONFIGURATION FOR BETTER UNDERSTANDING .

 

Thanks in advance!

2 REPLIES 2

ankitmarwah
Tera Expert

Better to go with Scheduled Script and couple of notifications for Group Managers, In case group manager is no longer active then check for associated Application Service linked to identify the owner however in case owner is also no longer active then follow the hierarchy till Technical Service then add some buffer before deactivation.

 

Other approach is to create certification for group managers with attestation questionnaires who have to review half yearly review it and failure to do so will lead to group deactivation post due date ignoring reminders.

Better to track it via Due date field and Exception that can help you in filtering the groups for deactivation.

  • Best practices
    • Extend the group table to capture the custom field or create custom table in scoped application to track activities.
  • Query logic
    • Try to filter with Group Type, Due Date and Exception that will help to filter group that should not be deactivated and closely monitored by platform or specialized teams.
  • Scripted approach (Business Rule/Scheduled Script)
    • Better go scheduled script job that will help you to calculate days filtering business days and holdidays.
  • Potential risks
    • Groups will be deactivated and persons will not be able to work upon incidents until group is activated again.
    • Bear with groups having integration roles as this may fail integrations running via system accounts in case not tracked via group type.

Hi @ankitmarwah  if possible could you please provide me configuration steps , it will help me more