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

Access Import Job is failing

PiyushRai
New Contributor
New Contributor

Access import job is failing, we have some users who have entitlements and some users who do not have any entitlements on target application. Our access import is giving null pointer error for the users that do not have any entitlements.

Below is the ImportAccountEntJSON:

{
"accountParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"statusAndThresholdConfig": {
"statusColumn": "customproperty4",
"activeStatus": [
"true"
],
"deleteLinks": false,
"accountThresholdValue": 1000,
"correlateInactiveAccounts": true,
"inactivateAccountsNotInFile": false
},
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://xyz.com",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpMethod": "GET"
},
"listField": "Resources",
"keyField": "accountID",
"statusConfig": {
"active": "true",
"inactive": "false"
},
"colsToPropsMap": {
"accountID": "id~#~char",
"status": "active~#~char",
"name": "userName~#~char",
"customproperty1": "name.givenName~#~char",
"customproperty2": "name.familyName~#~char",
"customproperty3": "emails[0].value~#~char",
"customproperty4": "active~#~char",
"customproperty31": "#CONST#${List responseList = response.entitlements; if(responseList?.size() == 0){return null }else{Map entMap = new HashMap();Map test1 = new HashMap();int size = responseList.size();int i = 0;for(Map map: responseList){Map test = new HashMap();List ents = new ArrayList();i++;if(map.workspaceId.toString().equals('dd85ea63-a3f8-4162-856b-c85f4ea93ddc')){ents.add(map.role);test.put('entIds',ents);test.put('keyField','entitlementID');test1.put('SandboxRole',test);if(i == size){return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}else if(map.workspaceId.toString().equals('1986c774-6861-4d82-a00b-1f68d5a9de81')){ents.add(map.role);test.put('entIds',ents);test.put('keyField','entitlementID');test1.put('Role',test);if(i == size){return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}else{if(i == size){test1.put('Role',test);return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}} } }~#~char"
},
"pagination": {
"offset": {
"offsetParam": "startIndex",
"batchParam": "count",
"batchSize": 10,
"totalCountPath": "completeResponseMap.totalResults"
}
}
}
}
},
"entitlementParams": {
"connection": "acctAuth",
"processingType": "SequentialAndIterative",
"entTypes": {
"Role": {
"entTypeOrder": 0,
"entTypeLabels": {
"customproperty1": "Workspace ID"
}
},
"SandboxRole": {
"entTypeOrder": 1,
"entTypeLabels": {
"customproperty1": "Workspace ID"
}
}
}
},
"acctEntParams": {
"processingType": "acctToEntMapping"
}
}

1 REPLY 1

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @PiyushRai,

As you mentioned above , users who dont have entitlment are getting null pointer exception,
Can you confirm if the entitlment are being imported for the user who have the entitlment.
Also try with the below expression in the CP 31. 
#CONST#${List responseList = response.entitlements; if(responseList == null || responseList?.size() == 0){return null }else{...}

sample

{
  "accountParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "statusColumn": "customproperty4",
      "activeStatus": [
        "true"
      ],
      "deleteLinks": false,
      "accountThresholdValue": 1000,
      "correlateInactiveAccounts": true,
      "inactivateAccountsNotInFile": false
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "url": "https://xyz.com",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpMethod": "GET"
        },
        "listField": "Resources",
        "keyField": "accountID",
        "statusConfig": {
          "active": "true",
          "inactive": "false"
        },
        "colsToPropsMap": {
          "accountID": "id~#~char",
          "status": "active~#~char",
          "name": "userName~#~char",
          "customproperty1": "name.givenName~#~char",
          "customproperty2": "name.familyName~#~char",
          "customproperty3": "emails[0].value~#~char",
          "customproperty4": "active~#~char",
          "customproperty31": "#CONST#${List responseList = response.entitlements; if(responseList?.size() == 0){return ''}else{Map entMap = new HashMap();Map test1 = new HashMap();int size = responseList.size();int i = 0;for(Map map: responseList){Map test = new HashMap();List ents = new ArrayList();i++;if(map.workspaceId.toString().equals('dd85ea63-a3f8-4162-856b-c85f4ea93ddc')){ents.add(map.role);test.put('entIds',ents);test.put('keyField','entitlementID');test1.put('SandboxRole',test);if(i == size){return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}else if(map.workspaceId.toString().equals('1986c774-6861-4d82-a00b-1f68d5a9de81')){ents.add(map.role);test.put('entIds',ents);test.put('keyField','entitlementID');test1.put('Role',test);if(i == size){return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}else{if(i == size){test1.put('Role',test);return new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(test1)}}} } }"
        },
        "pagination": {
          "offset": {
            "offsetParam": "startIndex",
            "batchParam": "count",
            "batchSize": 10,
            "totalCountPath": "completeResponseMap.totalResults"
          }
        }
      }
    }
  },
  "entitlementParams": {
    "connection": "acctAuth",
    "processingType": "SequentialAndIterative",
    "entTypes": {
      "Role": {
        "entTypeOrder": 0,
        "entTypeLabels": {
          "customproperty1": "Workspace ID"
        }
      },
      "SandboxRole": {
        "entTypeOrder": 1,
        "entTypeLabels": {
          "customproperty1": "Workspace ID"
        }
      }
    }
  },
  "acctEntParams": {
    "processingType": "acctToEntMapping"
  }
}

 Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".