preventing Inactive Groups from being assigned incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2011 06:17 AM
We have an org change and we are deactivating groups as needed. The problem I am running into is that we have a client script ((BP) Set Assignment Group to ci) that populates the assignment group field whether or not the group is active or not.
Client Script: (BP) Set Assignment Group to ci
function onChange(control, oldValue, newValue, isLoading) {
if(!isLoading && document.getElementById('incident.assignment_group')){
if (newValue == '') {
g_form.setValue('assignment_group', '');
}
if (newValue != oldValue) {
var ci = g_form.getValue('cmdb_ci');
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('sys_id', ci);
gr.query();
if (gr.next()) {
g_form.setValue('assignment_group', gr.support_group);
}
}
}
Does anyone have any idea on how to update this script so that if the assignment_group.active == false set the assignment group to a specific group, else keep the assignment group = gr.support_group
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2011 08:29 AM
I recommend doing a lookup on the retrieved group and checking the active state before updating the assignment group field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 07:33 AM
This is obvious that new incidents can't be assigned , If predictive intelligent system is doing that then it's means this should be fixed at product level. There can be a checkbox in settings to control that behaviour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2011 10:59 AM
It could look something like this
function onChange(control, oldValue, newValue, isLoading) {
if(!isLoading) {
if (newValue == '') {
g_form.setValue('assignment_group', '');
}
if (newValue != oldValue) {
var ci = g_form.getValue('cmdb_ci');
var gr = new GlideRecord('cmdb_ci');
gr.addQuery('sys_id', ci);
gr.query();
if (gr.next()) {
var sgrp = gr.support_group;
var grp = new GlideRecord("sys_user_group");
if (grp.get(sgrp)) {
if (grp.active == 'true'){
g_form.setValue('assignment_group', gr.support_group);
}
else {
g_form.setValue('assignment_group', gr.change_control);
}
}
}
}
}
}
The gr.change_control is just another group field that I used to test this. You could set any other group there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2011 11:41 AM
that did it, thank MB