Configure auto group assignment for each services on the change form

Cynthia19
Tera Contributor

I am trying to figure out how to auto assign assignment group for each service. 

 

For example on the OOTB change form I select "Email", I would like to auto assign to assignment group "Help Desk"

 

 

P:s: How can I add additional option to the available selection in the assignment group field

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Cynthia,

 

Although, I complete go with @MD AQUIB KHAN 's code, If you looking for something OOTB configuration, then you can leverage Assignment Rule module under Routing and Assignment Application which is slightly easier to use. 

Below is the steps you can follow.

Go to Assignment rules module under Routing and Assignment Application

1. 

Gagan5_1-1668794115498.png

 

2. Select the table and under conditions choose 'Service' field and choose the correct Service. 

3. Now go to 'Assign to' Section and add the 'Group' which you want the routing to happen. This will make sure that when you select the 'Service' field, then the assignment group field will be auto populated.

Gagan5_2-1668794298357.png

 

Please mark helpful/Give a thumbs up, if this inline with your expectation.

Regards,

Gagan k

View solution in original post

4 REPLIES 4

MD AQUIB KHAN
Giga Guru

Hi Cynthia,

Did you want to auto populate assignment group based on Service? 

We can do this using Client scripts by making Glide Ajax call.  I can share the scripts with you.

Also, one important point: On the Change Form, Based on CI, the assignment group gets populated as well.

It may override as well. You have to validate if there are any mapping done for assignment group based on CI.  

Please let me know if you have additional thought.

 

Thanks,

Aquib

Could you kindly share the script please. Thank you

Hi Cynthia ,

Prerequisite: Service(cmdb_ci_service) support group should not be empty.

if you are using change group/support group from service to populate assignment group on the Change form. It should not be empty.

I am using support group form service (cmdb_ci_service).

 

MDAQUIBKHAN_0-1668778415138.png

 

Output:

MDAQUIBKHAN_1-1668778462179.png

 

Please find the scripts below:

//Client Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var gr = new GlideAjax('CostCentre');
    gr.addParam('sysparm_name', 'getchangeService');
    gr.addParam('sysparm_service', newValue);
    gr.getXML(mycallback);
    function mycallback(response) {
        var answer = response.responseXML.documentElement.getAttribute('answer');
        alert(answer);
        g_form.setValue('assignment_group', answer);
    }

}
Script Include:
getchangeService: function() {
    var grgroup;
    var gruser = this.getParameter('sysparm_service');
    var grci = new GlideRecord('cmdb_ci_service');
    grci.addQuery('sys_id', gruser);
    grci.query();
    while (grci.next()) {
        grgroup = grci.getDisplayValue('support_group'); // Basically I am passing the CI Support Group. Also It can be 
        change group or approval group 
    }
    return grgroup;
},

 

Community Alums
Not applicable

Hi Cynthia,

 

Although, I complete go with @MD AQUIB KHAN 's code, If you looking for something OOTB configuration, then you can leverage Assignment Rule module under Routing and Assignment Application which is slightly easier to use. 

Below is the steps you can follow.

Go to Assignment rules module under Routing and Assignment Application

1. 

Gagan5_1-1668794115498.png

 

2. Select the table and under conditions choose 'Service' field and choose the correct Service. 

3. Now go to 'Assign to' Section and add the 'Group' which you want the routing to happen. This will make sure that when you select the 'Service' field, then the assignment group field will be auto populated.

Gagan5_2-1668794298357.png

 

Please mark helpful/Give a thumbs up, if this inline with your expectation.

Regards,

Gagan k