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

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

code snippet

@Nisha30 

so scripts are not working?

what debugging did you perform?

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

Hi @Ankur Bawiskar 

 

Creation of NEW Incident only does not give any alert message . 

Tried changing the fields but nothing happens

 

Thanks