Script to auto populate

Nisha30
Kilo Sage
 
1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Refer to this Nisha, similar thread is answered here

Solved: populate Assignment group based on the selected se... - ServiceNow Community

 

Here is the Server side script, just ad it to a script include and call from client script

Getservicesupportgroup: function(){
var servicename = this.getParameter('sysparm_service');      //sys_id of service
var getgrp = new GlideRecord('cmdb_ci_service');
getgrp.get(servicename);     //goes straight to the service glide record
if(getgrp){          //if there is a glide record
    var supGroupCorrId = getgrp.support_group.u_correlation_id.getDisplayValue();
    if(supGroupCorrId.indexOf('I-')==0 || supGroupCorrId.indexOf('V-')==0)
        return;
    else
        return getgrp.support_group;   //sys_id of the support group
}
-Anurag

View solution in original post

7 REPLIES 7

@Nisha30 

what debugging did you do?

Did you add gs.info() in script include and see if ajax function is being called?

what came in alert as response from script include?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar 

yep have checked gs.info();

seems the SI is not called.

 

 

@Nisha30 

then first check if script include is client callable or not, also see if GlideAjax syntax is correct and you are calling the correct script include and function

then once it's getting called see if the parameter is getting passed or not correctly

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader