Hello All,
In the approval workflow we are using custom assignment with 'select User Field' as 'Custom Query'.
In the SQL query we added few conditions to satisfy and based on that it should assigned to admin or Franchisee user group. But when there is more than one member in the user group approval is getting assigned to the Admin(userkey 1).
Below is the SQL:
select CASE WHEN count(raa.attribute_value) then (select uu.userkey from usergroup_users uu, user_groups ug where uu.USER_GROUPKEY=ug.USERGROUPKEY and ug.USER_GROUPNAME='${requestedby.customproperty31}') else 1 end as 'userkey' from request_access_attrs raa , ars_requests ar, request_access ra WHERE ar.REQUESTKEY = ra.REQUESTKEY and
ra.REQUEST_ACCESSKEY = raa.REQUEST_ACCESS_KEY and ar.requestkey=${ARSREQUEST.id} and ((raa.ATTRIBUTE_NAME='accountname' and raa.attribute_value in(
select acc.name from accounts acc where acc.endpointkey=261) > 0) or (raa.ATTRIBUTE_NAME='AccType' and raa.attribute_value = 'DEP Account'))
Thanks,
Deepali