- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 03:01 PM
so far i have a ref qualifer in the services field and it should take as arguement the sysid of the Config Item field once selected
below is my script include that i tried in a background script and it pulls the sys id,
getCiServices: function(ciID) {
if(ciID == ''){
return;
}
var myReturn = [];
var CIUtil = new CIUtils();
//get a server record
var server = new GlideRecord("cmdb_ci");
server.addQuery("sys_id", ciID);
server.query();
if (server.next()) {
//get the affected services, array of ids
var serviceIds = CIUtil.servicesAffectedByCI(server.getUniqueValue());
for (var i = 0; i < serviceIds.length; i++) {
//get the service record
var service = new GlideRecord("cmdb_ci_service");
service.get(serviceIds[i]);
myReturn.push(service.sys_id);
}
}
return myReturn;
},
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:29 PM - edited 06-13-2024 05:33 PM
See if this works for you. Normally when I use a javascript in a reference qualifier, I try to keep it self contained like so.
In your original code, I did notice you are missing a parentheses when referencing the script Include testUtils().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 05:29 PM - edited 06-13-2024 05:33 PM
See if this works for you. Normally when I use a javascript in a reference qualifier, I try to keep it self contained like so.
In your original code, I did notice you are missing a parentheses when referencing the script Include testUtils().