Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Create / Edit Schedule

Cobee
Tera Expert

I'm trying to restrict the Select Group dropdown in the On-Call Scheduling > Create / Edit Schedule wizard so that users only see:

  • Groups they are a member of, or
  • Groups they manage

Currently the dropdown appears to show all records from sys_user_group, including groups unrelated to On-Call Scheduling.

3 REPLIES 3

Its_Azar
Mega Sage

Hi there @Cobee 

Update the group query so it returns groups where current user is a member (sys_user_grmember)
OR current user is the group manager (manager = gs.getUserID())

avoid changing the sys_user_group reference qualifier globally, that could impact other places using the group table.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Architect@ KPMG.

What group query are you referring to?

IbrarA
Tera Guru

Hi @Cobee,

That dropdown isn't driven by a reference qualifier on sys_user_group, so there's nothing to change on the field itself. The list is built by the OnCallSecurityNG script include, which you'll find referenced in the On-Call table ACLs. getGroups is the function that populates the group-selector dialog, isManagerOfAnyGroup controls who gets the New button, and rotaMgrAccess handles edit access on existing schedules. Adding a "member of" condition means extending getGroups, which is a customization on an OOB script include, so it will need reviewing at every upgrade.

There's also a Now Support KB covering this exact question, KB0791303 (Can users Create / Edit On-Call Schedule Module?). Worth reading before changing anything:

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0791303

ibrar