Record producer: Issues with autopopulate assignment groups, category and subcategory fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 10:54 AM
Hi so I'm trying to autopopulate the sub category and assignment group as well as the category based on producer subcategory. As i try to define the set value, im being met with error
any help this is for a client script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 11:07 AM
@Yamlet8 try the following script.
function onSubmit() {
var gr1 = new GlideRecord('sys_user_group');
gr1.addQuery('name', <group name>);
gr1.query();
if (gr1.next()) { //hopefully as the producer populates the incident ticket it populates the below information
//need a replacement for specification when setting group instead of set value
try {
if (g_form.getValue(problem_subcategory) == '<sub cat name>') {
g_form.setValue(assignment_group, '<group sys_id>'); //Provide sys_id of the group here.
}
} catch (err) {
g_form.addErrorMessage("A runtime error occured: 2 " + err);
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 12:35 PM
I will give this a try, thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:48 PM
no luck, I am not seeing the setvalue results in the incident record after record producer submission, i will make additions to the list of categories and subcategories in the system definition table and add assignment rules or business rules.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 06:50 PM
Hello, Are you using record producer? If yes you can do it from record producer script which is server side code rather than client script. Also Best Practice do not use glide record in client script.
Record Producer script:
//get subCategory Value
if(producer.problem_subcategory) == '<sub cat name>') {
current.assignment_group = "grp sysID"; // set group on incident table
}
Harish