Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Reopen errored task through analytics

asharma
Regular Contributor II
Regular Contributor II

Hi Team,

We are trying below query to reopent the errored task in ARS through analytics. Please confirm if below query is good to proceed.

select taskkey as tasks, STATUS , provisioningtries, 'reopenTasks' as 'Default_Action_For_Analytics' from arstasks where status=8 and PROVISIONINGTRIES>1 and taskkey='<add taskkey>';

17 REPLIES 17

PremMahadikar
Valued Contributor
Valued Contributor

Hi @asharma ,

For failed task, we are using below query. Its similar as you are using with additional filters.

 

select 
	taskkey as tasks, 
	(select username from users where userkey = ars.userkey) as Requestee, 
	(select concat(firstname,' ',lastname) from users where userkey = ars.userkey) as 'Requestee Name', 	
	CASE 
		when tasktype = 1 then "Add access" 
		when tasktype = 2 then "Remove access / Account" 
		when tasktype = 3 then "New account" 
		when tasktype = 4 then "Role request"
		when tasktype = 5 then "Change password"
		when tasktype = 6 then "Enable account"
		when tasktype = 8 then "Delete account"
		when tasktype = 9 then "Update user"
		when tasktype = 12 then "Update account" 
		when tasktype = 14 then "Disable account"
		when tasktype = 18 then "Create user (From create user tile)"
		when tasktype = 19 then "Update user (From update user tile)"
		when tasktype = 24 then "Create entitlement"
		when tasktype = 25 then "Add access entitlement"
		when tasktype = 26 then "Remove access entitlement"
		when tasktype = 27 then "Update entitlement"
		when tasktype = 28 then "Delete entitlement"
	END as Operation, 
	CASE 
		when status = 1 then 'OPEN' 
		when status = 8 then 'ERROR' 
	end TASKSTATUS,  
	PROVISIONINGTRIES as 'Provisioning tries',  
	UPDATEDATE as 'Completetion Date', 
	'reopenTasks' as 'Default_Action_For_Analytics' 
from 
	arstasks
where
	status in ('8','1')
	and (PROVISIONINGCOMMENTS like '%Error%' OR PROVISIONINGTRIES > 1)
	and taskkey='<taskkey>'

 

 

If you find the above response useful, Kindly Mark it as Accept As Solution and hit Kudos

rushikeshvartak
All-Star
All-Star

Yes above query is correct


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

asharma
Regular Contributor II
Regular Contributor II

When I am trying the above query, I am getting below error. Kindly suggest me if I am missing anything.

asharma_0-1713799866045.png

 

@asharma ,

Below will work, please try.

 

select 
	ars.taskkey as tasks, 
	(select username from users where userkey = ars.userkey) as Requestee, 
	(select concat(firstname,' ',lastname) from users where userkey = ars.userkey) as 'Requestee Name', 	 
	ars.PROVISIONINGTRIES as 'Provisioning tries',  
	ars.UPDATEDATE as 'Completetion Date', 
	'reopenTasks' as 'Default_Action_For_Analytics' 
from 
	arstasks ars
where
	ars.status in ('8','1')
	and (ars.PROVISIONINGCOMMENTS like '%Error%' OR ars.PROVISIONINGTRIES > 1)

 

If you find the above response useful, Kindly Mark it as Accept As Solution and hit Kudos

Please share logs

select taskkey as tasks, STATUS as taskstate , provisioningtries, 'reopenTasks' as 'Default_Action_For_Analytics' from arstasks where status=8 and PROVISIONINGTRIES > 0 and taskkey='<add taskkey>';


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

asharma
Regular Contributor II
Regular Contributor II

Above query doesn't gave any error but it is also not giving any records. It says 0 records. However, there is 1 error task in completed task list.

@asharma ,

Maybe provisioning tries or taskid is filtering records.

Can you just try without any filters.

select taskkey as tasks, STATUS as taskstate , provisioningtries, 'reopenTasks' as 'Default_Action_For_Analytics' from arstasks where status=8

This should work for sure. Post this, please debug by adding filters suggested above.

 

If this answers your question, please Accept As Solution and hit Kudos

asharma
Regular Contributor II
Regular Contributor II

@PremMahadikar  this query is working but we need for specific task as this is challenging to identify specific task from the huge list.

@asharma ,

The below should be more clear for filtering your task:

My 'Completed task' has one errored task:

PremMahadikar_0-1713863786695.png

In data analyzer, I can see this record:

PremMahadikar_1-1713863890665.png

Use the same in data analyzer to see your record in preview and run it:

Query:

select taskkey as tasks, STATUS as taskstate , provisioningtries, 'reopenTasks' as 'Default_Action_For_Analytics' from arstasks where status=8 and taskkey='<Your task ID from Completed tasks tab>'

If this answers your question, please Accept As Solution and hit Kudos

Share query output from data analyzer

select taskkey as tasks, STATUS as state , provisioningtries, 'reopenTasks' as 'Default_Action_For_Analytics' from arstasks where status=4 and PROVISIONINGTRIES>1;


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

asharma
Regular Contributor II
Regular Contributor II

@rushikeshvartak it does have huge list of records however it's difficult to find specific task.

asharma_0-1713854079968.png

 

Manu269
All-Star
All-Star

@asharma can you share the screenshot from analytics page?

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

asharma
Regular Contributor II
Regular Contributor II

asharma_0-1713866055885.png

 

@asharma ,

Can you please remove all other actions and just add 'Reopen Tasks' and try above code with taskkey.

Manu269
All-Star
All-Star

@asharma check this post :

Solved: customqueryjob & enhancedqueryexecution job update... - Saviynt Forums - 70751

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

asharma
Regular Contributor II
Regular Contributor II

This worked, thankyou Manish Kumar

Its workaround ideally you should re open task using default action


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.