How to auto populate Assignment Group , Category, SubCategory and service based on service offering

Madhusudhan Kan
Tera Contributor

for Incident How to auto populate Assignment Group , Category, SubCategory and service based on service offering.

 

i am trying on use client script on onchange but its working can one help.

below is script I have used.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

var ser = g_form.getValue('service_offering');

if(ser == 'ALLIANCE BI');
{
g_form.setValue('category' , 'abce');
g_form.setValue('subcategory' , 'Business ');
g_form.setValue('assignment_group' , 'sap');
g_form.setValue('business_service' , 'SAP ALLIANCE');

}

 

 

5 REPLIES 5

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Madhusudhan Kan 

 

It is better to use Data Lookup Definition instead of Client Script where no scripting is required.

 

In your new Data Lookup Definition, you can make 'service offering' as Matcher Field and Assignment Group , Category, SubCategory and service as Setter Field

 

Now you can set values of these field for mapping. 

 

This is best way in case of multiple values and mapping.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Madhusudhan Ka1
Tera Contributor

Hi @AnubhavRitolia 

 

it is not working

 

@Madhusudhan Ka1 @Madhusudhan Kan 

 

Can you show what you have tried?

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hari Prasath
Tera Guru

Hi @Madhusudhan Ka1 

 

Have you tried using the assignment rule, I think you can achieve your requirement using the assignment rules, because you just want to set the assignment group, category and subcategory. 

 

Please mark my answer as helpful, if it helped you accordingly!

 

Thanks,

Hari