No ratings
sahil
Saviynt Employee
Saviynt Employee

Symptoms

Accounts are not getting created in target application and we see the below error message

DEBUG println.PrintlnToLogger - Println :: | Error Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('"' (code 34)): was expecting comma to separate Object entries
 at [Source: 

Diagnosis

The error message observed is due to the way json is constructed.

The json constructed is as below and is using New keyword. The new keyword is blocked in the latest release due to security restrictions.

[{"firstName": "${user.firstname==null? '': user.firstname+' ('+user.username+')'}","surName": "${user.lastname==null? '': user.lastname}","supervisorLoginAccount": "${def g=com.saviynt.ecm.identitywarehouse.domain.User_accounts.findAllWhere([userkey: userManager.id]).collect{com.saviynt.ecm.identitywarehouse.domain.Accounts.findWhere([id:it.accountkey])}.findAll{it.endpointkey.id==4L&&!it.name.contains('Deleted')};if(g!=null&&!g.isEmpty()){g[0].name}}","uiLanguage": "en-US","countryCode": "${user.customproperty8==null? '': user.customproperty8}","telephone": "${user.phonenumber==null? '': user.phonenumber}","loginType": "2","loginAccount": "${user.username==null? '': user.username+'@alstomgroup.com'}","email": "${user.email==null? '': user.email}","validUntil": "2999-12-31","costCenterCode": "${user.costcenter==null? '': user.costcenter}","validFrom":"2022-12-22","title": "${user.title==null? '': user.title}","loginAllowed": true,"CompanyCode": "Alstom","externalCode": "${user.username==null? '': user.username}","groups":[]"lastUpdated": "${(new Date()).format(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\")}"}] 

Solution

We can use ${Calendar.getInstance().getTime().format('yyyyMMddHHmmss')}Z function instead of ${(new Date()).format('yyyyMMddHHmmss')}

Version history
Last update:
‎01-08-2023 02:38 PM
Updated by:
Contributors