- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 07:54 AM
Hi Team,
We have an assignment where we have to auto populate the assignment group as per the service offering select by users but there is catch where we have to auto populate a default assignment group(for example : level 1) where the service Offering doesn't have any support group attached to it.
I have tried to implement UI policy by following condition along with script but while loading it in Incident form everything is working but the assignment group is not changing to deafult group as mentioned above rather it throws an error : onChange script error: RangeError: Maximum call stack size exceeded function () { [native code] }
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 11:07 AM
Hi @Abhi_007 ,
Check the below code for onChange client script , this code will trigger onChange service field and get the group information from "cmdb_ci_service" table [ used column : Manage by group ] and set on incident form, the default group sys_id given ( you can change with correct sys_id );
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
// get the reference object of selected service on incident form
var group = g_form.getReference("business_service");
if(group.managed_by_group != ''){
g_form.setValue("assignment_group",group.managed_by_group); // group coming from cmdb_ci_service table
} else {
g_form.setValue("assignment_group", 'd625dccec0a8016700a222a0f7900d06'); // sys_id of default group
}
}
This code is working perfectly on my PDI.
Service & Assignment Group, both are not mandatory OOTB but you have use case for "mandatory" assignment group on "State" change to resolved when "Assigned to" not empty then write the separate client script to validate it, don't mix two separate dependencies on "Service" column.
-Thanks
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 08:00 AM
Hi @Abhi_007 ,
Seems like some kind of recursion going on with assignment field, please share the code you have written for default assignment.
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 08:23 AM
What’s UI policy condition for true / false decision which field you are checking.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2023 08:35 AM