Getting results from CLI command inside a script
Hi,
i want to get the email address from a user inside a trigger script using the Integrity API. I've used mksapiviewer --iplocal im users --fields=email USERNAME to check if there is an output at all and it returned a response including a work item containing the field "Value" where the address is stored. I've tried
var eb = bsf.lookupBean("siEnvironmentBean");
var apibean = eb.createAPISessionBean();
var command = new Packages.com.mks.api.Command("im", "users");
command.addOption(new Packages.com.mks.api.Option("fields", "email");
command.addSelection(USERNAME);
var response = apibean.executeCmd(command);
var workitems = response.getWorkItems();
while(workitems.hasNext()){
var thisItem = workitems.next();
var val = thisItem.getField("Value");
}
Somewhere has to be a mistake since i get a NoSuchElementException: Value
Does somebody have an idea where the problem is??
Thanks!

