There are multiple entities in vRA data model that the business group (aka provisioning group) can be determined from, such as Owner, VirtualMachineTemplate, etc. But when I try to get a link to the Business Group I always get an empty array.
Can you see anything wrong with the code below?
var model = "ManagementModelEntities.svc";
var entitySetName = "VirtualMachines";
var virtualMachines = vCACEntityManager.readModelEntitiesByCustomFilter(vcacHost.id, model, entitySetName, null, null);
for each (var vm in virtualMachines) {
var owner = vm.getLink(vcacHost, "Owner");
var provisioningGroup = owner[0].getLink(vcacHost, "ProvisioningGroup");
System.log(provisioningGroup);
}