and more in a single search tool across platforms. Read the announcement here. |
11/09/2023 09:30 PM
Hi I want to send \”Action”\:\”Update\” if account has any associated entitlement in my endpoint in Saviynt or else send \”Action”\:\”SAVE\” to the target . How can I achieve this please?
11/10/2023 07:28 AM
What kind of JSON are you referring to here? Is this create account or update account or add access?
11/10/2023 08:50 PM
This is for Add Access.
11/12/2023 09:59 PM
One way to do this is using multiple calls in the Add Access JSON. 1st call - make API call to get all the assigned entitlements for the user from the target. 2nd call - determine the existing entitlements for the account based on output of the 1st call, and proceed to have if-condition for the Action in the 2nd call.
11/13/2023 01:18 AM
Hi yes, Im trying this only now. here is the postman response of first call
[{"active":false,"isTACUser":false,"profiles":[]}
I want to check if Active=false in GET , then POST SAVE else post UPDATE . For this I've written below JSON for Action attribute. However it keeps sending UPDATE. Am I missing anything?
\"action\": \"${(response.ROLE1.message.active=='false')?'SAVE':'UPDATE'}\",
I did try message[0].active=='false' too. didntwork
11/13/2023 03:41 AM
You may want to try the following:
${('false'.equalsIgnoreCase(response.'ROLE1'.message.active)) ? 'SAVE' : 'UPDATE' }
Please post the full JSON that you are using.
11/13/2023 04:37 AM - edited 11/13/2023 04:50 AM
Now below is the error response. please note that now task is NOT getting closed !
{"GACROLE1":{"headers":"XXXXXX","message":[{"active":false,"isTCCUser":false,"profiles":[]}],"statusCode":200,"description":null,"status":"Success"},"auditDetails":{"GACROLE2":[{"message":"Unrecognized token '$': was expecting ('true', 'false' or 'null')\n at [Source: [Printing whole JSON of httpParams of ADD access , THEN line: 1, column: 339] (through reference chain: java.util.ArrayList[0])","status":"Failed"}
Action Attribute JSON : \"action\": \"${('false'.equalsIgnoreCase(response.'GACROLE1'.message.active)) ? 'SAVE' : 'UPDATE' }\",
11/13/2023 07:03 AM
I assumed that the false/true would be string.
You may want to try the following:
${(false==response.'GACROLE1'.message.active) ? 'SAVE' : 'UPDATE' }
11/13/2023 07:44 AM - edited 11/13/2023 07:46 AM
Now something strange happening, first time I run WSretry, the Add Access task doesn't get completed and throws similar error as above but on different column, " line: 1, column: 318] (through reference chain: java.util.ArrayList[0])","status":"Failed"}]},"
When I rerun WSretry, task gets completed but I see in the Saviynt logs, action was sent as 'UPDATE'
11/13/2023 10:24 AM
Share full JSON
11/13/2023 11:33 AM - edited 11/13/2023 12:48 PM
.
11/13/2023 11:36 AM
Did you tried
${(false==response.'GACROLE'.message.active) ? 'SAVE' : 'UPDATE' }
11/13/2023 11:40 AM - edited 11/13/2023 11:41 AM
Let me retry now..I think I tried
11/13/2023 11:49 AM
I tried this now and task is not being completed. I see the first call was a success. GACROLE2 has error like shared earlier
{"GACROLE1":{"headers":"XXXXXX","message":[{"active":false,"isTCCUser":false,"profiles":[]}],"statusCode":200,"description":null,"status":"Success"},"auditDetails":{"GACROLE2":[{"message":"Unrecognized token '$': was expecting ('true', 'false' or 'null')\n at [Source: [Printing whole JSON of httpParams of ADD access , THEN line: 1, column: 319] (through reference chain: java.util.ArrayList[0])","status":"Failed"}
11/13/2023 12:23 PM - edited 11/13/2023 01:00 PM
I tried the below and for my first task, it sent SAVE and another it sent UPDATE. thanks @amit_krishnajit @rushikeshvartak for your help so far. Appreciate it!
\"action\": \"${(false==response.GACROLE1.message[0].active) ? 'SAVE' : 'UPDATE' }\"
however, not sure why Add Access task is getting closed ONLY when I run the Wsretry twice. now another concern is, when I raised 1 access request for 2 entitlements together, it sent SAVE for both ? But I think it is happening because active is not changing immediately from false to true as when I raise another access request, in the GET call we are getting active:true and and then it sent UPDATE.