and more in a single search tool across platforms. Read the announcement here. |
04/16/2024 12:54 AM - edited 04/16/2024 12:59 AM
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.
04/16/2024 03:14 AM
@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}\"}",
04/16/2024 10:02 PM
In this case you need all taskIds also in same response isn't it ?
04/24/2024 10:25 PM - edited 04/24/2024 10:26 PM
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
04/25/2024 09:50 PM
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';}}