Advance Reference Qualifier on Configuration Item variable on Incident Form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2024 08:32 AM
Hi,
I've a variable on the INC form 'Configuration item' (cmdb_ci). When I tried to put a VDI name (virtual machine instance) and I see it's showing 3 entries. When I checked the name in cmdb_ci table, I see that out there are 3 records showing with the same name and out of which 1 is in active state and other are inactive.
Then I see the existing reference qualifier configured in the INC form which is as below -
Hence, my requirement is to add a new condition which says, the reference field should pick from 'cmdb_ci_vm_instance' table having 'install_status' != 16 (this is for Deactivated).
Can anyone please help me to get this done?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 02:07 AM
Hi @Brad Bowman ,
Precisely below is the screenshot of an INC form -
When I'm checking 'configure dictionary' of the reference filed, I see that there is reference qualifier has been mentioned on the task table which I've provided the screenshot in my question.
Also, regarding the Dictionary Override, below is the screenshot for the same -
Let me know what more needs to be added in the reference qualifier, so that in the he reference field should pick from 'cmdb_ci_vm_instance' table having 'install_status' != 16 (this is for Deactivated). It should populate only active VM instances keeping existing functionality as it is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 04:34 AM
Thanks for confirming that you do not have an Override reference qualifier on the incident table. If your task table reference qualifier is otherwise working, try to not impact that by just adding to the end of it something like this:
+ '^sys_idNOTIN' + new incUtils().getVM()
so you're just taking the existing filter and adding sys_idNOTIN then a list of inactive VMs that you can get from another SI call. This isn't the best approach as it involves 2 server calls for the qualifier, but you can try to combine them later if there's a performance issue. You can use a new function in the same SI if you want. It just needs to execute a GlideRecord on the vm_instance table and return a joined array of records that are deactivated, something like this:
var vmArr = [];
var records = new GlideRecord('cmdb_ci_vm_instance');
records.addQuery('install_status', '16');
records.query();
while (records.next()) {
vmArr.push(records.sys_id.toString());
}
return vmArr.join(',');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 02:24 AM
Hi @Brad Bowman ,
I tried to create a Script Include that you've mentioned bt getting below error. Can you please look into it -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 05:58 AM
The SI doesn't need to be Client callable for a reference qualifier, but that's not hurting anything. Line 4 should just be
getVM: function() {
as () are not used in function name declarations, and you are not passing in an argument from the calling reference qualifier in this case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 07:36 AM - edited ‎09-11-2024 07:39 AM
Hi @Brad Bowman ,
I tried, but unable to select anything in the configuration item reference field on the INC form. Below is the screenshot -
My requirement is to it should not include the VMs where install_status = Deactivated (16). And it'll show other install status VMs