Major Incident Manager of Particular Group is only able to Promote the Proposed Major Incident.

Deepak Shaerma
Kilo Sage

Hi Community,

I have 2 Assignment group named as "Software" and "Hardware". and both group managers have major_incident_manager role. 

 

My requirement is :- if i select assignment group as Software. then only the Manager of Assignment group was able to promote the incident after proposed as a major incident candidate. How to achieve it...

Problem is that both managers will see the option for promote the incident as a major incident.

 

1 ACCEPTED SOLUTION

Suma Mallidi
Tera Expert

Hi @Deepak Shaerma,

In your case, you need to abort the action if the Hardware assignment group manager is promoting an incident that is assigned to the Software assignment group and vice versa.

 

One issue that we will face with hiding UI action is Software Assignment Group Manager can directly create a major incident using the "Major Incident" create module. So better to abort the action if the wrong assignment group manager is promoting a major incident.

 

In order to achieve this follow the below steps:-

Step 1:-

Create a Display Business Rule:-

SumaMallidi_0-1682170966014.png

SumaMallidi_1-1682170994941.png

Business rule Code:-

(function executeRule(current, previous /*null when async*/) {

// Add your code here
var assignment_group_sysIds = ['9a52796e979e6110faa9737e6253aff3','b162b1ae979e6110faa9737e6253afbb'];
//Sys_id's of software and hardware assignment groups
var group_obj = new GlideRecord('sys_user_group');
group_obj.addQuery('sys_id','IN',assignment_group_sysIds.join());
group_obj.addQuery('manager',gs.getUserID());
group_obj.query();
if(group_obj.next())
{
g_scratchpad.group_id = group_obj.sys_id;
}

})(current, previous);

 

Step 2:-

Create an OnSubmit Client script:-

SumaMallidi_2-1682171108234.png

On Submit Client Script Code:-

function onSubmit() {
//Type appropriate comment here, and begin script below
var action_name = g_form.getActionName();
if(action_name == 'sysverb_mim_accept'){
if (g_form.getValue('assignment_group') == g_scratchpad.group_id) //Software Group SysID
{
return true;
}
else
{
g_form.addErrorMessage('Invalid selection of assignment Group');
return false;
}
}
}

Please mark helpful and accept the solution if it helped you.

Regards,

Suma.

View solution in original post

3 REPLIES 3

Long Duong
Kilo Sage

hello @Deepak Shaerma 

 

In your case, I think we can modify the condition of that UI action to achieve your case.

 

Best Regards,

Long

Suma Mallidi
Tera Expert

Hi @Deepak Shaerma,

In your case, you need to abort the action if the Hardware assignment group manager is promoting an incident that is assigned to the Software assignment group and vice versa.

 

One issue that we will face with hiding UI action is Software Assignment Group Manager can directly create a major incident using the "Major Incident" create module. So better to abort the action if the wrong assignment group manager is promoting a major incident.

 

In order to achieve this follow the below steps:-

Step 1:-

Create a Display Business Rule:-

SumaMallidi_0-1682170966014.png

SumaMallidi_1-1682170994941.png

Business rule Code:-

(function executeRule(current, previous /*null when async*/) {

// Add your code here
var assignment_group_sysIds = ['9a52796e979e6110faa9737e6253aff3','b162b1ae979e6110faa9737e6253afbb'];
//Sys_id's of software and hardware assignment groups
var group_obj = new GlideRecord('sys_user_group');
group_obj.addQuery('sys_id','IN',assignment_group_sysIds.join());
group_obj.addQuery('manager',gs.getUserID());
group_obj.query();
if(group_obj.next())
{
g_scratchpad.group_id = group_obj.sys_id;
}

})(current, previous);

 

Step 2:-

Create an OnSubmit Client script:-

SumaMallidi_2-1682171108234.png

On Submit Client Script Code:-

function onSubmit() {
//Type appropriate comment here, and begin script below
var action_name = g_form.getActionName();
if(action_name == 'sysverb_mim_accept'){
if (g_form.getValue('assignment_group') == g_scratchpad.group_id) //Software Group SysID
{
return true;
}
else
{
g_form.addErrorMessage('Invalid selection of assignment Group');
return false;
}
}
}

Please mark helpful and accept the solution if it helped you.

Regards,

Suma.

Mallidi Suma
Tera Guru

Hi @Deepak Shaerma ,

 

I would suggest you abort the submission if the Software group manager tries to promote a major incident that is assigned to the Hardware Group.

 

There is one drawback if we hide the UI actions accordingly, the Software group manager can directly create a major incident and assign it to the Hardware Group. Just to avoid this try the below approach,

 

Follow the below Steps:-

 

Step 1:-

Create a Display Business rule:-

MallidiSuma_0-1682182798541.png

MallidiSuma_1-1682182822267.png

 

Business Rule Code:-

(function executeRule(current, previous /*null when async*/) {
var assignment_group_sysIds = ['9a52796e979e6110faa9737e6253aff3','b162b1ae979e6110faa9737e6253afbb'];
//Replace the above Sys Ids with your Software and Hardware Assignment Group
var group_obj = new GlideRecord('sys_user_group');
group_obj.addQuery('sys_id','IN',assignment_group_sysIds.join());
group_obj.addQuery('manager',gs.getUserID());
group_obj.query();
if(group_obj.next())
{
g_scratchpad.group_id = group_obj.sys_id;
}

})(current, previous);

 

Step 2:-

Create an OnSubmit Client Script:-

MallidiSuma_2-1682182907626.png

 

OnSubmit Client Script:-

function onSubmit() {
//Type appropriate comment here, and begin script below
var action_name = g_form.getActionName();
if(action_name == 'sysverb_mim_accept'){
if (g_form.getValue('assignment_group') == g_scratchpad.group_id) //Software Group SysID
{
return true;
}
else
{
g_form.addErrorMessage('Invalid selection of assignment Group');
return false;
}
}
}

 

Please mark my answer as helpful, if it helps!!