I have a transform map targetting the Application service & a OnAfter script which will…
- User
I have a transform map targetting the Application service & a OnAfter script which will map the Application and Business application togather. The script is working fine in creating the relationship, however instead of app service to become a parent, I need Business App to be the parent and child will be app service. Here is the code. Can someone suggest ?
[19:02] Bose, Nilanjan (function runTransformScript(source, map, log, target /undefined onStart/ ) { var appRel = target.u_application_release_cit_id; var businessAppSysID; var getBusinessApplication = new GlideRecord("cmdb_ci_business_app"); getBusinessApplication.addEncodedQuery("correlation_id=" + appRel); getBusinessApplication.query(); if (getBusinessApplication.next()) { businessAppSysID = getBusinessApplication.sys_id; var cmdbRelGR = new GlideRecord("cmdb_rel_ci"); //cmdbRelGR.addEncodedQuery('parent=' + target.sys_id + '^child=' + businessAppSysID); cmdbRelGR.addEncodedQuery('parent=' + businessAppSysID + '^child=' + target.sys_id); cmdbRelGR.query(); if (!cmdbRelGR.next()) { cmdbRelGR.initialize(); // cmdbRelGR.parent = target.sys_id; // cmdbRelGR.child = businessAppSysID; cmdbRelGR.parent = businessAppSysID; cmdbRelGR.child = target.sys_id; cmdbRelGR.type = "Consumes::Consumed by"; cmdbRelGR.insert(); } } else { ignore = true; } })(source, map, log, target);
- Assistant
Your script appears generally correct for making the Business Application the parent of the Application Service. The key parts for doing so are:
- User
I have a requirement on servicenow, that if user has raised a request and if his location is blank then request get auto assigned to servicedesk. kindly assign such task to IT asset group.
- Assistant