Assignment group Assign To is not populated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2022 11:46 PM
Hello All,
My requirement is in the service portal create incident part I have created some variables in which when category is hardware and sub category is mouse,
then Assignment group should be Hardware
Assign To should be Fred Luddy
I have written below script but the category and subcategory is working properly but assignment group and assigned_to is not populate.
if(producer.category == 'hardware' && producer.sub_category == 'mouse'){
current.setDisplayValue('assignment_group', 'Hardware');
//current.assignment_group = '8a5055c9c61122780043563ef53438e3';
current.setDisplayValue('assigned_to', 'Fred Luddy');
}
let me know what is issue with my script.
Thanks & Regards
Keval
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2022 04:51 AM
The category and subcategory is working only assignment group and assign_to is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2022 04:58 AM
Try to pass sys_ids of assignment group and assigned to instead of passing hardcoded values also add gs.log("Going inside of loop") inside if loop and see what it is printing after submission of form. Try below code once.
if(producer.category == 'hardware' && producer.sub_category == 'mouse'){
gs.log("Going inside loop");
current.assignment_group = "sys id of hardware group"
current.assigned_to = "sys of fred";
}
gs.log("Assignment group is " +current.assignment_group + " Assigned to is " +current.assigned_to);
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2022 05:07 AM
Also, you can write assignment rule like below and make it work instead of writing code in record producer. give a try. keep order as '10' so that it runs first and add value of group and assigned to directly in 'Assign to' tab. mark my answer as correct in case if it resolves your issue
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2022 12:19 AM
Hello,
Please use the below:-
var group='sysidofthegroup';
current.assignment_group.setDisplayValue(group);
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2022 04:46 AM
Hi Saurav,
The script is not working in my case
Regards
Keval