how to populate assignment group based on category in client scripts

Vijay27
Tera Guru

please provide the script 

2 REPLIES 2

Prateek kumar
Mega Sage

You'll need an onchange client script. Check this out

http://www.servicenowelite.com/blog/2014/2/19/client-scripts-examples

 

Please mark this post as helpful or the correct answer to your question if applicable.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Harsh Vardhan
Giga Patron

scenario here: whenever you will select category as hardware then assignment group will set hardware.

 

Note: you can try with that and made some changes according to your requirement. 

 

sample script:

 

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

//Type appropriate comment here, and begin script below
var ct = g_form.getValue('category');
if(ct == 'hardware' )
{
g_form.setValue('assignment_group','8a5055c9c61122780043563ef53438e3'); //sysid of group . i just added hardware group sysid
}

}