Hello,
I'm working on a new workflow and I'm attempting to pull the current users email address from their user account record into the workflow.
This is a small workflow to ensure I can use the functionality in larger workflows, but for some reason I error out on the script.
Here's the script:
ContactList = cmdb.queryClass("User").withAttribute("Id", _CurrentUser.getId()).fetch
Contact = ContactList.get(0);
ContactMap = Contact.getAttributes();
contName = ContactMap.get("Description");
contEmail = ContactMap.get("Email");
contUname = ContactMap.get("Username");
Yes I realise that some of my classes start with lowercase chars.
Here's the error I get:
2014-08-11 14:10:05,798: BshToolAgent - application ContactList = cmdb.queryClass("User").withAttribute("Id", _CurrentUser.getId()).fetch();
Contact = ContactList.get(0);
ContactMap = Contact.getAttributes();
contName = ContactMap.get("Description");
contEmail = ContactMap.get("Email");
contUname = ContactMap.get("Username"); terminated incorrectly: Sourced file: eval stream : Method Invocation fetch : at Line: 1 : in file: eval stream : .fetch ( )
Target exception: javax.xml.ws.soap.SOAPFaultException: Fault occurred while processing.
2014-08-11 14:10:05,798: cannot execute tool agent - application terminated incorrectly
Sourced file: eval stream : Method Invocation fetch : at Line: 1 : in file: eval stream : .fetch ( )
Has something changed in the API? This code snippet worked for me previously.
Any suggestions would be great, thanks.
Jamie