Auto-Approve Time Card entries (ELA) when Line Manager submits
Summary:
We have a lot of employees with multiple assignments so we use ELA. When a Line Manager submits a time card on behalf of an employee, we would like to auto-approve the entries for that manager's assignments. I have been able to get this to work for the manager of the Primary assignment but not the non-primary. I am using the following IF statement to auto-approve the manager's assignments when the Primary manager is the one submitting:
Approval.TimeRecordGroup.createdB is RequestManager.managerUsername
and
ApprovalTimeRecordGroup.attributeNumber2 is GetRequestorInformationByUserNameResponse.result.assignmentId
I can use HierarchyBuilder.getManager("supervisory",Task.payload.process.requester,ApprovalTimeRecordGroup.attributeNumber2,null,"LINE_MANAGER") to identify the manager of the non-primary assignments but a) I don't know what data this function returns (it doesn't appear to be Username) and b) I can't find anything but the Username/Person Number (the same for us) for the person who submits the time card and c) I can't find any way to convert a Person ID to a Username or vice versa.