Get Assignment group based upon Business service in the Incident form

Gowtham29
Tera Expert

everyone,

We have business service 'Blackberry' with support group 'Capacity Mgmt'

When ever the business service is selected as 'Blackberry' then the assignment group look up list needs to show only 'Capacity Mgmt'. Now if we select business service as 'Blackberry' then the assignment group look up list showing up all the groups. I need only one record should be displayed based upon the support group of business service which we selected. Please see the below screenshot for your reference.

find_real_file.png

 

find_real_file.png

I need to show up only record here based upon business service but currenlty it was listing 31 groups here. Please help me to resolve this and Thank you in advance

7 REPLIES 7

Dubz
Mega Sage

You could put a reference qualifier on the assignment group field so it only shows the group associated with the current business service but you might as well just populate it on the form when the business service changes. You'll need an onChange client script and a glide ajax call to a script include eg:

//onchange script on business service field:

var ga = new GlideAjax('u_ScriptIncludeName');
ga.addParam('sysparm_name', 'functionName');
ga.addParam(sysparm_business_service', g_form.getValue('business_service');
ga.getXMLAnswer(getAjaxResponse);

function getAjaxResponse(response){
var answer = JSON.parse(response);
g_form.setValue('assignment_group', answer.sysID, answer.displayValue);
}

script include (must be named the same as your glide ajax ie u_ScriptIncludeName and tick the client callable box):

functionName: function(){
var businessService = this.getParameter('sysparm_business_service');
var obj;
var gr = new GlideRecord('business_service')
if(gr.get(businessService)){
obj = {
"sysID": gr.getUniqueValue(),
"displayValue": gr.getDisplayValue()
};
}
return JSON.stringify(obj);
}

Hi David,

I wrote client script as you suggested but seems to be not working as desired and we do not need to populate it on the form when the business service changes only i need to show up the group associated with the business service. Please find below screenshots for your reference and please help me with the reference qualifier condition. Thank you so much

find_real_file.png

find_real_file.png

 

Hi David,

Can you please respond to my above post and tell me how to put reference qualifier on assignment group field. Thank you.

I'm not sure if you can dot-walk in advanced reference qualifiers, you could try this:

javascript: 'sys_id=' + current.business_service.assignment_group

If that doesn't work you can write a simple script include with function like:

function getGroup(){
var gr = new GlideRecord('business_service');
if(gr.get(current.business_service)){
return 'sys_id=' + gr.getValue('assignment_group'); //replace with field name of assignment group on business service form
}
}

and call it like:

javascript: getGroup()