Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

addaccess json issue

alvian
Regular Contributor
Regular Contributor

Hi folks 

I've an addaccess json 

{
"call": [
{
"name": "Role",
"connection": "userAuth",
"url": "https://url/compass/v1/post-users-save",
"httpMethod": "POST",
"httpParams": "{ \"name\": \"${user.displayname}\", \"email\": \"${user.email}\", \"productOwner\": \"${if{requestAccessAttributes?.get('productowner') == 'BOTH' ? 'ID1;ID2' : requestAccessAttributes?.get('productowner')}\", \"role\": \"${entitlemntValue.entitlement_value}\", \"validity\": \"${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, +365); it.time }.format('yyyy-MM-dd HH:mm:ss')}\" }",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
}
]
}
but the result is 

alvian_0-1727969118595.png

dynamic attribute configuration 

alvian_1-1727969190140.png


I've check with testconnectionparams for validity field in the connectionjson it was success 

"testConnectionParams": {
          "http": {
            "url": "https://url/compass/v1/post-users-save",
            "httpContentType": "application/json",
            "httpMethod": "POST",
            "httpParams": "{ \"name\": \"Admin\", \"email\": \"user@example.com\", \"productOwner\": \"BOTH\", \"role\": \"COMPASS_TESTER\", \"validity\": \"${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, +365); it.time }.format('yyyy-MM-dd HH:mm:ss')}\" }",
            "httpHeaders": {
              "Authorization": "${access_token}",
              "accept-encoding": ""
            }
          }
alvian_0-1727969368807.png

[This post has been edited by a Moderator to merge two posts.]

4 REPLIES 4

NM
Honored Contributor II
Honored Contributor II

@alvian share logs.

*Mask the sensitive data

And try ${user.displayName}

alvian
Regular Contributor
Regular Contributor

there is no issue with that variable, I also used that variable for create accountjson and it was a success 

{
"accountIdPath": "accountName",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://url/compass/v1/post-users-save",
"httpMethod": "POST",
"httpParams": "{ \"name\": \"${user.displayname}\", \"email\": \"${user.email}\", \"productOwner\": \"\", \"role\": \"\", \"validity\": \"\" }",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
}
}
]
}

result 

alvian_0-1727973014740.png

the logs:

alvian_1-1727973899018.png

 

NM
Honored Contributor II
Honored Contributor II

@alvian try this 

 

{

"call": [

{

"name": "Role",

"connection": "userAuth",

"url": "https://url/compass/v1/post-users-save",

"httpMethod": "POST",

"httpParams": "{ \"name\": \"${user.displayname}\", \"email\": \"${user.email}\", \"productOwner\": \"${(requestAccessAttributes?.get('productowner')) == 'BOTH' ? 'ID1;ID2' : requestAccessAttributes?.get('productowner')}\", \"role\": \"${entitlemntValue.entitlement_value}\", \"validity\": \"${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, +365); it.time }.format('yyyy-MM-dd HH:mm:ss')}\" }",

"httpHeaders": {

"Authorization": "${access_token}",

"Accept": "application/json"

},

"httpContentType": "application/json",

"successResponses": {

"statusCode": [

200

]

}

}

]

}

alvian
Regular Contributor
Regular Contributor

"httpParams": "{ \"name\": \"${user.displayname}\", \"email\": \"${user.email}\", \"productOwner\": \"${(requestAccessAttributes?.get('productowner') == 'BOTH') ? 'ID1;ID2' : requestAccessAttributes.get('productowner')}\", \"role\": \"${entitlementValue.entitlement_value}\", \"validity\": \"${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, +365); it.time }.format('yyyy-MM-dd HH:mm:ss')}\" }",

I using this httpparams above and it was success.. thanks