Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

vRealize 7 Gather 'Who Approved' via EBS

$
0
0

So I am attempting to gather who approved a request via EBS for review. The code works when I run it in vRO but fails when called via EBS in vRA. I am leaning towards this being a bug and I was curious if anyone else has attempted this, sees an issue with my code, or could even run a similar test in their own environment. When run by EBS, VCACCAFEEntitiesFinder doesn't return anything at all for enumeration.

 

baeHost = Server.findAllForType("vCACCAFE:VCACHost")[0];
var baeCrs = baeHost.createCatalogClient().getCatalogConsumerRequestService();
var baeReq = baeCrs.getRequest(baeReqId);
var baeApv = vCACCAFEEntitiesFinder.getWorkItems(baeHost);
var baeApprover = "";
for each (var i in baeApv) {
 System.log(i); //Never fires once when run by EBS
 var baeApvProp = i.workItemRequest.getItemData();
 if (baeApvProp.containsKey("requestInstanceId")) {  if (baeApvProp.get("requestInstanceId").value == baeReq.id) {   baeApprover = baeApprover + "(" + i.completedBy +  " - " + i.completedDate + ")";  }
 }
}
System.log("Request: " + baeReq.name + " Id: " + baeReq.id + " Approver: " + baeApprover);
if (baeApprover.length > 0) { return baeApprover } else { return "Auto-Approved" }
//var baeApv = baeHost.createWorkItemClient().getWorkItemWorkItemService().getAllWorkItems().getContent(); <-- also
//             attempted this method but it only returns manual actions and not approvals.

 

To make matters more confusing, this works fine when called as part of an XaaS form (that runs in seconds) but does not work as part of MachineProvisioned for a blueprint that takes 15 minutes. If I manually run the exact same instance after the blueprint finishes, it works 100% of the time.

 

Thanks for any help. (This is in 7.1)


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>