and more in a single search tool across platforms. Read the announcement here. |
07/13/2023 04:13 AM
Team,
I am working on REST Connector.
To create an account, passing user's basic info in httpParams as shown below in Create Account JSON, But instead of picking the actual value it's passing the binding variable as it is.
JSON-
{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('PersonStatus')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeetype}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('CountryCode')}\", \"COMPANY\": \"${user.company}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('ManagerName')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('ManagerXguid')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('TS')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}
Here, instead of passing user's firstname and lastname value and other Http params from Saviynt, it is passing ${user.firstname} ${user.lastname} as it is to the target system. Hence user's account not getting created with actual name rather it name "${user.firstname} ${user.lastname}".
Point to note here: With the same JSON, when values are hardcoded then it is passing the actual hardcoded value. But when trying to capture the value using binding variable it doesn't work!
Can anyone please suggest, what could be wrong here? Am I missing anything?
Solved! Go to Solution.
07/13/2023 04:20 AM - edited 07/13/2023 04:24 AM
Hi @anuragG ,
Can you change the variable name to ${user.employeeType} and check.
Refer to the Developer's handbook for a list of all variables and their syntax:
Developers Handbook (saviyntcloud.com)
Behaviour: Even if any one of the Binding variable is misspelt / misused, none of the binding variables get resolved.
Thanks,
Armaan
07/13/2023 04:26 AM - edited 07/13/2023 04:28 AM
JSON-
{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('PersonStatus')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('CountryCode')}\", \"COMPANY\": \"${user.company}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('ManagerName')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('ManagerXguid')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('TS')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}
07/13/2023 04:29 AM
Update - When Dynamic attributes are hardcoded, only then the user object binding variables are working for eg below JSON works when i have hardcoded all the dynamic attributes.
{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{\"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"ACT\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"IND\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"Nikhil Sharma\", \"MANAGER_XGUID\": \"r7370HRJ\", \"TIME_STAMP\": \"13-Jul-23\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}
07/13/2023 04:30 AM - edited 07/13/2023 04:34 AM
Instead of dynamic attributes name using account column there
${requestAccessAttributes.get('customproperty1')}\"
or also validate spelling is correct for dynamic attributes
sample
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm#top
"${requestAccessAttributes.get('regions')}
Check the exact syntax from above link.
07/13/2023 06:17 AM
Hi
Is there any error that you see?
As per documentation, below should work. Please check if you are passing the correct name of the dynamic attribute.
"${requestAccessAttributes.get('ResourceOrgRoleCode')}\",\"SalesGroup_c\": \"${requestAccessAttributes.get('SalesGroup_c')}
https://docs.saviyntcloud.com/bundle/REST-v2020x/page/Content/Developers-Handbook.htm
07/13/2023 06:15 AM
Below is the lastest JSON and issue still persists.
{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://kcbgpje8lo700tl-epdwdev.adb.us-ashburn-1.oraclecloudapps.com/ords/xrx_wpr/IDM/R_IDENTITY_SOR",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${requestAccessAttributes.get('customproperty2')}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"${requestAccessAttributes.get('customproperty3')}\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"${requestAccessAttributes.get('customproperty5')}\", \"MANAGER_XGUID\": \"${requestAccessAttributes.get('customproperty4')}\", \"TIME_STAMP\": \"${requestAccessAttributes.get('customproperty1')}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [200]
}
}]
}
User objects are getting populated but not the Dynamic attributes.
07/13/2023 06:17 AM
These are the dynamic attributes if it helps -
All queries are working in Data analyzer.
07/13/2023 09:13 AM
On checking further it was found that when task are getting created for provisioning through rules (This EP is non requestable, to be provisioned as birthright to certain users based on rule), the dynamic attributes are not getting calculated. Any help there?
FYI everything works when we submit a request through ARS (for testing purpose only) as dynamic attributes gets calculated in that task and has this extra tab of 'Request Details'-
Task created from rules -
Am I missing something here? What can I do to have dynamic attributes get calculated for tasks created through requests?
07/13/2023 11:52 AM
When tasks generated outside Access Request this values will not be populated this is expected behaviour
07/13/2023 12:11 PM
Through rules you will not get DA values from requestAccessAttributes, Since you have default values assigned and mapped to account attributes as well can you try below variable and see if that works
${account.custompropertyxx}
07/14/2023 03:09 AM
Hi @sk @rushikeshvartak Thank you for the inputs.
${account.custompropertyxx}This doesn't work either and is getting passed as is. Any other suggestions?
07/14/2023 04:18 AM
Hi @anuragG ,
If you need to pass in the dynamic attributes in the json, you set the default value of all the dynamic attributes in their definition and that default value would be passed for all provisioning tasks created via provisioning rules using the normal dynamic attribute variable ${requestAccessAttributes.get('SalesGroup_c')}
Various Usage of Dynamic Attributes - Saviynt Forums - 37329 - 3rd point.
Thanks,
Armaan
07/14/2023 04:32 AM
Are those mandatory attributes you may need to use if else if rule then don’t update
07/14/2023 05:35 AM
@rushikeshvartak Can you please elucidate?
@armaanzahir The default value cannot be static if that's what you are suggesting. It needs to be calculated for every user. Please confirm if that possible.
07/14/2023 05:56 AM
Does those attributes which are fetched from dynamic attributed are mandatory?
if those are not mandatory then use condition in json to skip those attribute passed on target
07/14/2023 06:07 AM
Hi @anuragG ,
As suggested earlier, you have the option of using an SQl query for the default value parameter of the Dynamic attributes, no matter what the attribute type is (ENUM,String etc). Please use the SQL query to evaluate the dynamic attribute value based on the user's context and the same can be referred in the creation JSON.
select customproperty32 as ID from users where username='${user.username}'
Various Usage of Dynamic Attributes - Saviynt Forums - 37329 - 3rd point.
If this does not work, please raise an FD ticket as it's expected behavior for the default value query to be evaluated and made available for creation and modification jsons.
Thanks,
Armaan
07/17/2023 03:29 AM
@rushikeshvartak Can you please let me know the syntax for if else statements here? I am trying to accomodate all dynamic attrbutes in JSON only.
Also, is there any way to send system date in this format - 17-JUN-23 or DD-MON-YY. This was being done using this DA query - select date_format(CURRENT_DATE(),"%d-%b-%y") as ID
07/17/2023 03:30 AM
+ @rushikeshvartak if else statement required for this DA - select case when customproperty49='Active' then 'ACT' when customproperty49='Inactive' then 'INA' else 'SEP' end as ID from users where username='${user.username}'
07/17/2023 09:44 PM
What is ask JSON or DA Query
07/19/2023 08:10 AM - edited 07/20/2023 08:19 PM
Can we call deployed JARS from connectors JSON to get values from code.
{
"accountIdPath": "call1.message.id",
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "<URL>",
"httpMethod": "POST",
"httpParams": "{ \"XGUID\": \"${user.customproperty21}\", \"S3_USER_ID\": \"${user.username}\", \"PERSON_STATUS\": \"${com.adw.PersonStatus.getPersonstatus(user.customproperty49)}\", \"LAST_NAME\": \"${user.lastname}\", \"FIRST_NAME\": \"${user.firstname}\", \"EMAIL\": \"${user.email}\", \"S3_EMPLOYEE_TYPE\": \"${user.employeeType}\", \"COUNTRY_CODE\": \"CAN\", \"COMPANY\": \"${user.companyname}\", \"STREET\": \"${user.street}\", \"STATE\": \"${user.state}\", \"POSTAL_CODE\": \"${user.region}\", \"MANAGER_NAME\": \"Anurag Goyal\", \"MANAGER_XGUID\": \"x6w70\", \"TIME_STAMP\": \"${com.adw.SystemDateCalculator.getFormattedSystemDate()}\", \"RECORD_TYPE\": \"NEW\", \"SOR\": \"${user.customproperty15}\", \"FEED_PK\": \"${user.customproperty40}\", \"PERSONNEL_NUMBER\": \"${user.employeeid}\" }",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"successResponses": {
"statusCode": [200]
}
}]
}
\"TIME_STAMP\": \"${com.adw.SystemDateCalculator.getFormattedSystemDate()}\"
07/19/2023 08:25 AM
No
07/19/2023 09:24 AM
It seems to be working -
Java Code-
Payload passed-
07/19/2023 08:21 PM
Great. Can you attach Jar here
07/20/2023 08:18 PM
@rushikeshvartak Cannot share the JAR here as it contains confidential information.
FYI, this approach is working fine, I am now able to compute the 5 DA's from a JAR deployed in Saviynt Shared location whenever a birthright Task is created from rule.