if ( task.getPeopleAssignments() != null ) {
List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners();
if ( potentialOwners.size() == 1 ) {
// if there is a single potential owner, assign and set status to Reserved
OrganizationalEntity potentialOwner = potentialOwners.get( 0 );
// if there is a single potential user owner, assign and set status to Reserved
if(potentialOwner instanceof User){
taskData.setActualOwner( (User) potentialOwners.get( 0 ) );
taskData.setStatus( Status.Reserved );
}