- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 11:55 AM
Hi,
I need to populate assigned to based on assignment group. I have written this code and it is not working.
Please correct my code to make it work.
Regards,
Nivedita
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 03:44 AM
You can write below code in script include, its working on my PDI.
Script include code :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 11:22 PM
Can you update the Script as below
assignmentGrpUsers: function(usergroup) {
var arryVal = [];
if (usergroup!= '') {
var grMember = new GlideRecord('sys_user_grmember');
grMember.addEncodedQuery('group',usergroup);
grMember.query();
while (grMember.next()) {
arryVal.push(grMember.getValue("user"));
}
}
return "sys_idIN" + arryVal.join();
}
},
Add below Code in Advance Qualifier
javascript:assignmentGrpUsers(current.variables.assignment_group)
Attributes :
req_qual_elements=assignment_group
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 12:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:15 PM - edited 02-08-2024 10:24 PM
1. You need to make use of advanced reference qualifier in order to achieve this functionality.
In Referene Qualifier, you need to call script include where you can filter the groups and return the result to reference field assignment group.
You may refer this script,
Advanced Reference Qualifier Using a Script Include
Filter Assignment Group based on Assigned To
To know more about reference qualifiers,
2nd Approach create Onload Client script:-
function onLoad() {
if(g_form.isNewRecord()){
//Type appropriate comment here, and begin script below
var gr = new GlideRecord('sys_user_group');
gr.addQuery('name',"assignment group"); //as per my experience group name changes later during the time.
gr.query();
if(gr.next()){
g_form.setValue('assignment_group',gr.sys_id);
}
}
}
Please mark as Correct Answer and Helpful, if applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 10:44 PM - edited 02-08-2024 10:47 PM
try to use getDisplayValue() in your code.
var group = current.varaibles.assignment_group.getDisplayValue();
In Advance Reference Qualifier:
Javascript: new Script_Include().function_name();
Please mark as Correct Answer and Helpful, if applicable.