how to auto populate assignment group using assigned to user reference table by using client script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2024 07:09 PM
ihello,
“assigned to” is a reference with the "sys_user" table needs to populate the group name in the "assignment groups" where the reference is "sys_user_group". need a onchange() script without using scriptinclude.
give me input on how to do using on change() client script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var user= new GlideRecord('sys_user');
user.addQuery('name','');
user.query();
if(user.next()){
var groupname= user.getValue('name');
g_form.setValue('u_assignment_group',groupname);
}
else{
g_form.setValue('u_assignment_group','');
}
//Type appropriate comment here, and begin script below
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2024 08:43 PM
The issue with this approach is, a user could be in many groups, how do you know which group to pick? Tickets are usually assigned to a group first and then picked up from any user in the group. What is the use case to have it assigned to a person before a group?