Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/12/2024 07:54 AM
Hello,
I'm trying to retrieve some variables related to the roles/entitlements of the access request to be inserted in a ticket. Apart from the ${allEntitlementsValues} variable, I can't manage to communicate other entitlement-related variables such as ${entitlementValue.entitlementID}. Are these variables accessible in the CreateTicket JSON or only in the AddAccess / Remove Acccess JSON?
I'd like to communicate just the role / entitlement name and not the whole string of information contained in the ${allEntitlementsValues} variable.
Thanks
Solved! Go to Solution.
02/12/2024 11:21 PM
${task?.entitlementValueKey?.entitlement_value}
02/14/2024 10:40 AM
It works with this synxtax {task?.entitlement_valueKey?.entitlement_value}
However, I get the value of the entitlement linked to a single task in the request (just as if I use the task.id variable, I get the id of one task in the request).
By using the taskIds variable, I can retrieve all the tasks ID in the request. Is there a similar way of retrieving the value of the entitlements that corresponds to each of the tasks in the query (without using the ${allEntitlementsValues} variable, which isn't very useful in my context - I don't want entitlement_types, for example) ?
I'm still trying to work out how to use ${task?.entitlement_valueKey?.entitlement_value} and apply it to each of the request's tasks. Do you have a solution? Is it possible?
My goal is to send the following blocks in my ticket:
"add": "entitlement1,entitlement2,entitlement3", "remove": "entitlement4,entitlement5"
Thank's
02/14/2024 08:37 PM
We have done like below
\"Summary\" : \"${if(task.tasktype==1){'Add Access'}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Delete Account'}else if(task.tasktype==2){'Remove Access'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==12){'Update Account'}else if(task.tasktype==14){'Disable Account'}else{task.tasktype}} for ${endpoint.endpointname}\",
02/16/2024 12:45 AM
This doesn't address the problem.
Is it possible to obtain the names of the entitlements for each task in the request using the variable {task?.entitlement_valueKey?.entitlement_value} ? As it stands, this variable only returns the value of a task's entitlement and not for each task in the request.
If this isn't possible, I think I can transform the format of the ${allEntitlementsValues} variable using the replace() functions. However, I can't seem to apply this function to the variable. What is the correct syntax?
02/16/2024 02:47 AM
Hi @afauquem
Directly there is no variable for to take each individual task and print the variables, But you can try with below as shown below ( where it takes single task and mention all details )
Please explore this-
${if(taskIds != null && taskIds.size()>0){String result='';ArrayList arr = new ArrayList(taskIds); arr.eachWithIndex{ val, idx -> com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey!=null?result=result.concat(com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==1?'ADD:: ':com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==31?'Extend End Date :: ':'REMOVE :: ').concat(com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey!=null?com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlementtypekey.entitlementname+' : ':'').concat(com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value).concat(' : Access Start Date - ' + com.saviynt.ecm.task.ArsTasks.get(val)?.requestAccessKey?.startdate).concat(' : Access End Date - ' + com.saviynt.ecm.task.ArsTasks.get(val)?.requestAccessKey?.enddate).concat(' : Approved By - ' + com.saviynt.ecm.identitywarehouse.domain.Users.get(com.saviynt.ecm.task.ArsTasks.get(val)?.requestAccessKey?.collect{it.ae.findAll{it.jbpmActivityName.toString().equalsIgnoreCase('OwnerApproval')}}?.collect{it.approveby}.get(0).get(0)).displayname).concat('\\\\n'):'';}; return result}else{return '';}}
Thanks
Darshan
02/19/2024 08:42 AM - edited 02/19/2024 08:47 AM
Hi @Darshanjain,
Thank you for this payload. I understand the logic but as it stands it doesn't work. So I'm trying to use it step by step and I have a few questions.
I did the following test: 1 access request with 2 add access and 1 remove access with this httpparams.
"httpParams":"{\"entitlement\":\"${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==2?'REMOVE: ':com.saviynt.ecm.task.ArsTasks.get(val));}; return result}else{return '';}}\"}",
However, I can't get the values back with :com.saviynt.ecm.task.ArsTasks.get(val). With this payload i send this json :
{"entitlement":"ADD: ADD: REMOVE: "}
As you can see, the com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==1? works because it detects 2 add accesses and 1 remove access, so it retrieves the values for each task.
What correct syntax should I use to display the values of these variables?
Thanks
02/19/2024 08:54 AM
Hi @afauquem
What do you mean by However, I can't get the values back with :com.saviynt.ecm.task.ArsTasks.get(val)?
Are you looking to display the ent values inside the entitlements with add and remove and want it to be separtely displayed. can you give more clear and may be an example of what you want.
Thanks
Darshan
02/20/2024 12:27 AM
Hi @Darshanjain
Exactly, I want to display ent values separately like this :
{ "ADD":"ent_value1,ent_value2,ent_value3",
"REMOVE":"ent_value4,ent_value5"}
I try this to test but it doesn't display the ent values :
"httpParams":"{\"ADD\":\"${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?:com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value);}; return result}else{return '';}}\"}",
Do you have any idea to display the ent_values of each task in the create ticket JSON without the ${allEntitlementsValues} variables which hasn't good format in my case ?
Thanks
02/20/2024 02:57 AM
Hi @afauquem
Can you please use this variable
com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlementtypekey.entitlementname
Thanks
Darshan
02/20/2024 03:08 AM
I have the same issue, it doesn't displays the value.
02/20/2024 03:17 AM
Hi @afauquem
Even one ent value is not being displayed?
The variable is correct? what is it printing in the logs
Thanks
Darshan
02/20/2024 06:14 AM
Hi @Darshanjain ,
No ent value display, I have no errors. With the query below, it returns just the string "ADD" due to the condition tasktype==1 : {"entitlement":"ADD: ADD: "}
"httpParams":"{\"entitlement\":\"${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)?.entitlement_valueKey?.entitlement_value);}; return result}else{return 'nok';}}\"}",
I attach the logs.
Thanks
02/28/2024 05:26 AM
Hi everyone,
I'm sharing with you a solution that works to retrieve the value of each entitlement in the CreateTicketJSON part.
"httpParams":"{\"request_id\":\"${requestid}\"${if(taskIds != null && taskIds.size()>0){String result='';String result2='';String resultat3='';ArrayList arr = new ArrayList(taskIds);arr.eachWithIndex{val, idx ->com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==1?result=result.concat('{\"name\":\"'+com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value+'\"},'):com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==2?result2=result2.concat('{\"name\":\"'+com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value+'\"},'):'';};if (result.length()!=0){result=',\"roles_add\":['+result.substring(0, result.length() - 1)+']';};if(result2.length()!=0){result2=',\"roles_remove\":['+result2.substring(0, result2.length() - 1)+']';};if (result.length()!=0 && result2.length()!=0){result3=result+result2;}else {result3=result+result2;};return result3;}else{return '';}}}",