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

Requestkey check for tasks in ARS.

Saviynt_Savvy
Regular Contributor
Regular Contributor

I am adding a few entitlements and also removing a few entitlements through ARS in a single request.
Now irrespective of the tasktype, whether it is "task.tasktype=1" OR "task.tasktype=2", as the tasks have the same request key, I need to pass some static value.

How can I check that condition in the JSON.
Consider task1 as Add Access task and task2 as Remove Access task in the example below.

Example:
${(task1.getTaskType() == 1 && task1.getRequestKey().equals(task2.getRequestKey())) == (task2.getTaskType() == 2)}? 'staticvalue' : ''

Thanks & Regards,
Saviynt Savvy.

4 REPLIES 4

Raghu
Regular Contributor III
Regular Contributor III

@Saviynt_Savvy  below sample:

"httpParams": "{\"requested_by\":\"savyint\", \"requested_for\":\"${user.customproperty42}\", \"priority\":\"3\", \"assignment_group\":\"${endpoint.customproperty42}\",\"short_description\":\"${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}} to ${endpoint.endpointname} for the user ${task.accountName}\", \"description\":\"${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Disable Account'}} for Entitlements:${allEntitlementsValues},RequestID:${requestid}\"}",


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

In this case you need all taskIds also in same response isn't it ?


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

Hi @rushikeshvartak ,

Thanks for the reply.
TaskIDs are not required, I need to write a condition to check whether it is add access or remove access, if they have the same requestkey or not.
So that I can create a ticket in Freshservice.

Regards,
Saviynt Savvy

You need to get list of task types here and compare use below code to get all tasktype

${if(taskIds != null && taskIds.size()>0){String result='';ArrayList arr = new ArrayList(taskIds); arr.eachWithIndex{ val, idx ->result=result.concat(com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==1?'ADD: ':com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype);}; return result}else{return 'nok';}}


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