- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 07:38 AM
Hi Team,
I would really appreciate any help/guidance on how to achieve/modify the script I have, to achieve this.
On my Incident form I have a field for Service (business_service) and Business Application (u_business_application).
I want to put a Reference Qualifier on the Service (business_service) field, so that when Business Application is populated, the only options that show in the Service field are children of the parent Business Application.
I currently have the following script include and reference qualifier, which can be used to achieve the same, for showing CI's that relate to a service offering, but how can I amend this script include and the related reference qualifier javascript, so that I can achieve a similar process for only showing Service related to the Business Application.
Here is the Reference Qualifier Javascript I need to modify:
javascript: new IncidentUtils().getCis(current.service_offering);And Here is associated script include I am wanting to modify:
var IncidentUtils = Class.create();
IncidentUtils.prototype = {
getCis: function(so) {
var getCiArr = [];
if (so) {
var cm = new GlideRecord('cmdb_ci');
cm.addEncodedQuery('sys_class_name=service_offering');
cm.addQuery('sys_id', so);
cm.query();
if (cm.next()) {
var gr = new GlideRecord('cmdb_rel_ci');
gr.addQuery('parent', cm.sys_id);
gr.query();
while (gr.next()) {
getCiArr.push(gr.child.sys_id.toString());
}
return "sys_idIN" + getCiArr.join(',');
}
}
},
type: 'IncidentUtils'
};Thanks very much - any help/guidance, very much appreciated.
Solved! Go to Solution.