In script include if i found sysid then how to get short description value
- User
In script include if i found sysid then how to get short description value
- Assistant
- User
child.short_descriptionchild.short_description
- Assistant
- User
var shortDescription = gr.getValue(‘short_description’);
search all records whose short description is same
need script in serviecnow - Assistant
- User
var relGlide = new GlideRecord("cmdb_rel_ci); var queryString = "type=d93304fb0a0a0b78006081a72ef08444^child.ip_address=" +current.variables.ip_address; relGlide.addEncodedQuery(queryString); relGlide.query(); workflow.scratchpad.vm_flag = false; while (relGlide.next()){ //if any CI is operational if(relGlide.parent.operational_status ==1){ workflow.scratchpad.vm_flag = true; } }
i have a reference variable on my catalog item named as select_server and refer to cmdb_ci_server table records and the records of cmdb_ci_server table further linked to another table records cmdb_rel_ci table via ip address relationship. i want that if i select a server on catalog then it will check all records related to the server on cmdb_rel_ci table and check all records operational status field value. if the field is operational on cmdb_rel_ci table records then show a popup show that you cannot select because child record operatioal status is operational and clear the field value from catalog selected field
- Assistant
- User
heckOperationalStatus - Class.create(); operationalStatus.prototype = Object.extendsobject(AbstractAjaxProcessor, heckstatus: function() var serverSysId - this.getParameter('sysparm_server_sysId'); var serverGr new GlideRecord('cmdb_ci_server');| if (serverGr.get (serverSysId)) f var/ ipAdd - serverGr .getvalue('ip_address'); H var relGr = new GLideRecord('cmdb_rel_ci'); relGr.addQuery("child.ip_address', ipAdd); relGr.query(); while (relGr.next()) ( if (relGr.operational status == 1) ( alert("found a active");
correct this script include and give a client script for this servicenow
- Assistant