Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Getting Entvalukey:Null error in mapping Account to Entitlement - REST

Neeharika008
New Contributor
New Contributor

Hi Experts,

We are getting below error when we are trying to map accounts to entitlement

 

"2024-06-27T06:25:08.197+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-dw5lh","DEBUG","inside processAccountEntitlements"
"2024-06-27T06:25:08.197+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-dw5lh","DEBUG","ACCKEY:1197918746;ENTVALKEY:null"
"2024-06-27T06:25:08.197+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-dw5lh","DEBUG","inside

 

ImportAcctEntjson:

 

{
  "accountParams": {"connection": "userAuth1",
                        "processingType": "SequentialAndIterative",
                        "statusAndThresholdConfig": {},
                        "call": {
"call1": {
                        "callOrder": 0,
                        "stageNumber": 0,
                        "http": {
                        "url": "https://xxx.com/users",
                        "httpHeaders": {
                        "Authorization": "${access_token}",
                        "Accept": "application/json"
                        },
                        "httpContentType": "application/json",
                        "httpMethod": "GET"
                        },
                        "listField": "details",
                        "keyField": "accountID",
                        "colsToPropsMap": {
                        "accountID": "userlogin~#~char",
                        "name": "userlogin~#~char",
"customproperty1": "firstname~#~char",
                    "customproperty2": "lastname~#~char",
                    "customproperty3": "email~#~char"
                        }
                        }
  }
  },
 "entitlementParams": {  "connection": "userAuth1",
        "processingType": "SequentialAndIterative",
        "entTypes": {
          
"Roles": {
        "entTypeOrder": 0,
        "call": {
          "call1": {
            "callOrder": 0,
            "stageNumber": 0,
            "http": {
              "url": "https://xxx.com/users/roles",
              "httpHeaders": {
                "Accept": "application/json",
"Authorization": "${access_token}"
              },
              "httpContentType": "application/json",
              "httpMethod": "GET"
            },
            "listField": "details",
            "keyField": "entitlementID",
            "colsToPropsMap": {
              "entitlementID": "name~#~char",
              "entitlement_value": "name~#~char"
            }
          }
        }
      }
        }
  },
  "acctEntParams": {
     "entTypes": {
      "Roles": {
        "call": {
          "call1": {
            "connection": "userAuth1",
            "processingType": "http",
            "http": {
              "url": "https://xxx.com/users/roleassignment/user",
              "httpContentType": "application/json",
              "httpMethod": "GET",
              "httpHeaders": {
                "Authorization": "${access_token}"
              }
            },
            "listField": "details",
            "acctKeyField": "accountID",
            "entKeyField": "entitlementID",
            "acctIdPath": "userlogin",
            "entIdPath": "roles.rolename"
          }
        }
      }
    }
}
}
 
Postman response for roleassignemnet:
{
"details": [
{
"userlogin": "a.avi.k.kumar@test.com",
"firstname": "test",
"lastname": "Admin",
"email": "a.avi.k.kumar@test.com",
"roles": [
{
"rolename": "test"
},
{
"rolename": "User"
}

]
}
]
}

 
Only account import is successful, please suggest some solutions to import entitlement & to map them with imported accounts.
 
 
8 REPLIES 8

rushikeshvartak
All-Star
All-Star

Use Below json

{
  "accountParams": {"connection": "userAuth1",
                        "processingType": "SequentialAndIterative",
                        "statusAndThresholdConfig": {},
                        "call": {
"call1": {
                        "callOrder": 0,
                        "stageNumber": 0,
                        "http": {
                        "url": "https://xxx.com/users",
                        "httpHeaders": {
                        "Authorization": "${access_token}",
                        "Accept": "application/json"
                        },
                        "httpContentType": "application/json",
                        "httpMethod": "GET"
                        },
                        "listField": "details",
                        "keyField": "accountID",
                        "colsToPropsMap": {
                        "accountID": "userlogin~#~char",
                        "name": "userlogin~#~char",
"customproperty1": "firstname~#~char",
                    "customproperty2": "lastname~#~char",
                    "customproperty3": "email~#~char"
                        }
                        }
  }
  },
 "entitlementParams": {  "connection": "userAuth1",
        "processingType": "SequentialAndIterative",
        "entTypes": {
          
"Roles": {
        "entTypeOrder": 0,
        "call": {
          "call1": {
            "callOrder": 0,
            "stageNumber": 0,
            "http": {
              "url": "https://xxx.com/users/roles",
              "httpHeaders": {
                "Accept": "application/json",
"Authorization": "${access_token}"
              },
              "httpContentType": "application/json",
              "httpMethod": "GET"
            },
            "listField": "details",
            "keyField": "entitlementID",
            "colsToPropsMap": {
              "entitlementID": "name~#~char",
              "entitlement_value": "name~#~char"
            }
          }
        }
      }
        }
  },
  "acctEntParams": {
     "entTypes": {
      "Roles": {
        "call": {
          "call1": {
            "connection": "userAuth1",
            "processingType": "http",
            "http": {
              "url": "https://xxx.com/users/roleassignment/user",
              "httpContentType": "application/json",
              "httpMethod": "GET",
              "httpHeaders": {
                "Authorization": "${access_token}"
              }
            },
            "listField": "",
            "acctKeyField": "accountID",
            "entKeyField": "entitlementID",
            "acctIdPath": "details.userlogin",
            "entIdPath": "details.roles.rolename"
          }
        }
      }
    }
}
}
 

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Neeharika008
New Contributor
New Contributor

Hi @rushikeshvartak ,

It is not even mapping with account key using above JSON. Please find the logs below:

 

bjectList.size : 1"
"2024-06-28T08:32:08.350+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","inside processAccountEntitlements"
"2024-06-28T08:32:08.350+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","ACCKEY:null;ENTVALKEY:null"
"2024-06-28T08:32:08.353+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","delete inactive account linking: false"
"2024-06-28T08:32:08.354+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","Inside deleteAccountEntitlementsByEntType "
"2024-06-28T08:32:08.365+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","Deletion of old Account_entitlements1 complete"
"2024-06-28T08:32:08.366+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-6-qnp7w","DEBUG","processAccountEntitlementParams complete.."

In old logic try

roles.rolename[0]


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak 

Tried with above.. role is getting picked but if a user is having multiple roles it is getting picked the single role from user.

Please let me know how to get the list of roles assigned to users.

 

 

You need to use #CONST and use java code to loop the multiple values 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Neeharika008
New Contributor
New Contributor

Could you please provide some syntax if it is this way

{
"rolename": "test"
},
{
"rolename": "User"
}

Refer Sample for comma separated output 

https://forums.saviynt.com/t5/tag/CONST%20with%20comma/tg-p/board-id/iga


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Neeharika008
New Contributor
New Contributor

Hi @rushikeshvartak 

Tried this way  "entIdPath": "#CONST#${String roles = response.roles.collect{ '\"' + it.rolename+ '\"' }.join(', '); return '{roles}'}~#~char" but it still storing null value