PARTNERS - Please join us for our upcoming webinar:
Leveraging Intelligent Recommendations for Operational Transformation.
AMS Partners Click HERE | EMEA/APJ Click HERE

Runtime Analytics - Data Displayed Error

Manu269
All-Star
All-Star

Hello Team,

I have created below runtime analytics in our instance.

Custom - Reportee Access Details Report

SELECT
u.username,
u.manager as USERCONTEXT,
m.username AS manager_username,
CASE U.STATUSKEY WHEN '0' THEN 'INACTIVE' WHEN '1' THEN 'ACTIVE' END AS USERSTATUS,
accounts.name AS account_name,
endpoints.ENDPOINTNAME,
CASE WHEN accounts.STATUS IS NULL THEN 'NOT AVAILABLE' WHEN accounts.STATUS = 1 THEN 'ACTIVE' ELSE accounts.STATUS END 'ACCOUNT STATUS',
ev.entitlement_value
FROM
users u
LEFT JOIN user_accounts ua ON ua.userkey = u.userkey
LEFT JOIN accounts ON accounts.accountkey = ua.accountkey
LEFT JOIN endpoints ON endpoints.ENDPOINTKEY = accounts.ENDPOINTKEY
LEFT JOIN account_entitlements1 ae ON ae.accountkey = accounts.ACCOUNTKEY
LEFT JOIN entitlement_values ev ON ev.entitlement_valuekey = ae.entitlement_valuekey
LEFT JOIN entitlement_types et ON et.entitlementtypekey = ev.entitlementtypekey
LEFT JOIN users m ON m.userkey = u.manager
WHERE
u.statuskey = 1
AND accounts.STATUS IN (
'1', 'Active', 'Manually Provisioned'
);

When the respective manager logs into Saviynt he/she is able to view the data correctly.

Issue :

When we are invoking the above analytics via API :

https://manish.saviyntcloud.com/ECM/api/v5/fetchRuntimeControlsDataV2

by passing below attributes :

{
    // "analyticsname": "Custom - Reportee Access Details Report",
    "analyticsid": "1644",
    "max": "4",
    "offset": "0",
    "loggedinuser": "Chandan"
}
not sure why it is displaying all the data.
 
Requirement :
1. We need to provide the api to the monitoring application team with an service account to invoke these api.
2. So we need a case, where manager name has to be passed dynamically so that the system fetches only his reportee details.
 
Can someone assist urgently.
 

 

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.
3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Service account will be able to fetch data where that person is manager in this case you need to use different report for service account . User context is used for UI purpose


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Manu269
All-Star
All-Star

Hello All,

Fixed this as below :

SELECT
u.username AS 'USERNAME',
m.username AS 'MANAGER USERNAME',
CASE U.STATUSKEY WHEN '0' THEN 'INACTIVE' WHEN '1' THEN 'ACTIVE' END AS 'USER STATUS',
accounts.name AS 'ACCOUNT NAME',
endpoints.ENDPOINTNAME AS 'ENDPOINT NAME',
CASE WHEN accounts.STATUS IS NULL THEN 'NOT AVAILABLE' WHEN accounts.STATUS = 1 THEN 'ACTIVE' ELSE accounts.STATUS END 'ACCOUNT STATUS',
ev.entitlement_value AS 'ENTITLEMENT NAME'
FROM
users u
LEFT JOIN user_accounts ua ON ua.userkey = u.userkey
LEFT JOIN accounts ON accounts.accountkey = ua.accountkey
LEFT JOIN endpoints ON endpoints.ENDPOINTKEY = accounts.ENDPOINTKEY
LEFT JOIN account_entitlements1 ae ON ae.accountkey = accounts.ACCOUNTKEY
LEFT JOIN entitlement_values ev ON ev.entitlement_valuekey = ae.entitlement_valuekey
LEFT JOIN entitlement_types et ON et.entitlementtypekey = ev.entitlementtypekey
LEFT JOIN users m ON m.userkey = u.manager
WHERE
u.statuskey = 1
AND accounts.STATUS IN (
'1', 'Active', 'Manually Provisioned'
)
AND m.username ='${uname}';

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

In short as mentioned initially thats true usercontext cant be used and dynamic report needs to be used


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.