Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Can you please provide advance quires to trace the pending tasks for all terminated users.

anirban23
New Contributor III
New Contributor III

Hi all, 

Can you please provide advance quires to trace the pending tasks for all terminated users.

Thank you

2 REPLIES 2

naveenss
All-Star
All-Star

Hi @anirban23 please use the below sample query

select at.taskkey,u.username,at.tasktype from arstasks at,users u where at.userkey=u.userkey and u.statuskey=0 and at.status='1';

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

rushikeshvartak
All-Star
All-Star

Please use below query for your use case:
SELECT a.taskkey            AS 'TASK ID',
       a.taskdate           AS 'TASK CREATE DATE',
       a.updatedate         AS 'TASK UPDATE DATE',
       CASE
         WHEN a.tasktype = 1 THEN 'Add Access'
         WHEN a.tasktype = 2 THEN 'Remove Access'
         WHEN a.tasktype = 3 THEN 'NEW ACCOUNT'
         WHEN a.tasktype = 4 THEN 'NEW ROLE REQUEST'
         WHEN a.tasktype = 5 THEN 'CHANGE PASSWORD'
         WHEN a.tasktype = 6 THEN 'ENABLE ACCOUNT'
         WHEN a.tasktype = 14 THEN 'DISABLE ACCOUNT'
         WHEN a.tasktype = 12 THEN 'UPDATE ACCOUNT'
         WHEN a.tasktype = 8 THEN 'DELETE ACCOUNT'
         ELSE a.tasktype
       END                  AS 'TASK TYPE',
       u.username           AS 'USERNAME',
       CASE
         WHEN u.statuskey = 0 THEN 'Inactive'
         WHEN u.statuskey = 1 THEN 'Active'
         ELSE u.statuskey
       END                  AS 'User_Status',
       a.accountname        AS 'ACCOUNT NAME',
       s.systemname         AS 'Security System',
       e.endpointname       AS 'ENDPOINT NAME',
       ev.entitlement_value AS 'ENTITLEMENT VALUE',
       CASE
         WHEN a.status = 1 THEN 'NEW'
         WHEN a.status = 2 THEN 'IN PROGRESS'
         WHEN a.status = 3 THEN 'COMPLETE'
         WHEN a.status = 4 THEN 'DISCONTINUED'
         WHEN a.status = 5 THEN 'PENDING CREATE'
         WHEN a.status = 6 THEN 'PENDING PROVISIONING'
         WHEN a.status = 7 THEN 'PROVISIONING FAILED'
         WHEN a.status = 8 THEN 'ERROR'
         WHEN a.status = 9 THEN 'NO_ACTION_REQUIRED'
         ELSE a.status
       END                  AS 'TaskStatus'
FROM   arstasks a
       INNER JOIN users u
               ON u.userkey = a.userkey
       INNER JOIN endpoints e
               ON a.endpoint = e.endpointkey
       INNER JOIN securitysystems s
               ON s.systemkey = e.securitysystemkey
       LEFT JOIN entitlement_values ev
              ON a.entitlement_valuekey = ev.entitlement_valuekey
and u.statuskey=0 and a.status =1


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