The CreatorCon Call for Content is officially open! Get started here.

How to troubleshoot error "com.glide.script.RhinoEcmaError: "xml_baseline_string" is not defined." in a Scheduled Script

Sandip Kumar Ro
Kilo Contributor

I have created below Scheduled Script which will insert automated CI Relationships for DNS CI Records into the CMDB Relationship Table ( cmdb_rel_ci). 

However I am receiving below error:-

com.glide.script.RhinoEcmaError: "xml_baseline_string" is not defined. <refname> : Line(1) column(0) ==> 1: xml_baseline_string.

Please find the Scheduled Script below:-

 

cmdbUtil = new SWB_cmdbAutomationUtils();

var rel_type = "Depends on::Used by";
var targetDN;
var current_fqdn = current.fqdn.toString();

var dns_rec = new GlideRecord('u_cmdb_ci_dns_record');
dns_rec.addQuery('install_status', '!=',7);
dns_rec.addQuery('fqdn','!=','');
// //dns_rec.addEncodedQuery('install_statusNOT IN7^fqdnISNOTEMPTY');
dns_rec.addQuery('u_managed_by_service_offering','!=','')
.addOrCondition('u_contract_number','!=','');
dns_rec.query();
while (dns_rec.next())
{
if (!gs.nil(current_fqdn)){
try {targetDN = cmdbUtil.resolveDNSDomainFromFQDN(current_fqdn);}
catch(e){gs.error("SWB_rel_DNSRecordToDomainName: "+e.message);}

}
if (targetDN.isValidRecord()){
try {cmdbUtil.maintainCMDBRel(targetDN,rel_type,current);}
catch(e){gs.error("SWB_rel_DNSRecordToDomainName: "+e.message);}

}

 

Do you have any insight on how to troubleshoot this error. Any help would be highly appreciated.

2 REPLIES 2

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Sandip,

Try running the script from Script Background.

Try logging variables to make sure they are assigned to expected values.

Try commenting lines of code to determine the exact statement causing the error. Can't say too much because the script seems to be querying a custom table and calling custom script.

I'll probably use .addNotNullQuery() instead of checking for ''.

https://developer.servicenow.com/dev.do#!/reference/api/sandiego/server_legacy/c_GlideRecordAPI#r_Gl...

Sandip Kumar Ro
Kilo Contributor

Many thanks Ozawa for your inputs here!! We have reached an inch closer to our expected result. 🙂