task is that when we select a group in the Assignment Group field, only that grpmember see in assig

ishwarsingh
Tera Contributor
  • In this Rohit Sharma table, the task is that when we select a group in the Assignment Group field, then in the Assigned To field, it should display only the members of that particular group, not all users. Please write me the script. Please help on writing script
2 REPLIES 2

Rafael Batistot
Tera Sage

Hi @ishwarsingh 

 

This steps might help you 

 

  1. Go to System Definition > Dictionary.
  2. Search for the field Assigned to on the incident table.
    • Table name: incident
    • Field name: assigned_to
  3. Open the dictionary entry for that field.
  4. Scroll down to the Reference Specification section → find the Reference Qual field.
  5. Change the qualifier type to Advanced.
  6. Paste the script below:

 

javascript:'active=true^sys_idIN'+getIDs(current.assignment_group);

function getIDs(grp){
if (!grp) return ''; // return empty if no group is selected
var m = GlideUserGroup.getMembers(grp);
var ids = '';
while (m.next()){
ids += (m.user + ',');
}
return ids;
}

 

See the reference 

 

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

Chavan AP
Tera Guru

Screenshot 2025-08-30 at 06.06.28.png

please use dependent as assignment group

Chavan AP
[ Architect | Certified Professional]

Was this response helpful? If so, please mark it as ✅ Helpful and ✅ Accept as Solution to help others find answers.