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

Task.source=PROVRULE condition not working

Anu
Regular Contributor
Regular Contributor

Hi Team,

In UpdateAccountJSON for REST connector we have a requirement to perform the check for request source for country attribute. If request source is Provrule we should pass the value from account CP else if the request is submitted via ARS we should send the value based on the dynamic attribute property.However we are facing below error . PFA JSON

2024-02-20/13:14:32.022 [{}] [https-jsse-nio-443-exec-17] DEBUG domain.FlatViewJobcontrolController - ecmjobIdQuery .. select max(eij.JOBID) as 'JobId' from EcmImportJob eij where eij.TRIGGERNAME in (select qrt.TRIGGER_NAME from qrtz_triggers qrt) group by eij.TRIGGERNAME
2024-02-20/13:14:32.083 [{}] [quartzScheduler_Worker-5] ERROR rest.RestProvisioningService - Error in processWebservicecom.fasterxml.jackson.core.JsonParseException: Unexpected character ('t' (code 116)): was expecting comma to separate Object entries
at [Source: {"FirstName":"${user?.getFirstname()!=null?user?.getFirstname():account?.customproperty2}","LastName":"${user?.getLastname()!=null?user?.getLastname():account?.customproperty2}","Alias": "${if(user?.customproperty61!=null && user?.customproperty61.length()>8){user?.customproperty61.toLowerCase().substring(0,8)}else if(user?.customproperty61!=null &&

The Json works fine if we remove the below condition for country field .

"if (task.source == 'PROVRULE' && task?.tasktype==12) "

 

 

 

 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

task object is not exposed in UpdateAccountJSON 

rushikeshvartak_0-1708438423297.png

 


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

CR
Regular Contributor III
Regular Contributor III

@Anu  can you try like below

{\"short_description\":\"${if(task.source=='PROVRULE' && task?.tasktype==14){'[NO ACTION REQUIRED]:'} else if(task.tasktype==14){'[NO ACTION REQUIRED]:'}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

NM
Regular Contributor III
Regular Contributor III

Hi @Anu,

Binding variable you are using are not correct, try user?.firstname, user?.lastname

sai_kanumuri
Honored Contributor
Honored Contributor

Hi @Anu ,

Task object is not exposed for the UpdateAccountJson. Try using arsTasks.

"if (arsTasks.source == 'PROVRULE' && arsTasks?.tasktype==12) "

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

rushikeshvartak
All-Star
All-Star

Please try below

{
    "call": [
        {
            "name": "call1",
            "connection": "userAuth",
            "url": "https://xxxxxxx/services/data/v58.0/sobjects/User/${account?.accountID}",
            "httpMethod": "PATCH",
            "httpParams": "{\"FirstName\":\"${user?.firstname()!=null?user?.firstname():account?.customproperty2}\",\"LastName\":\"${user?.getLastname()!=null?user?.getLastname():account?.customproperty2}\",\"Alias\": \"${if(user?.customproperty61!=null && user?.customproperty61.length()>8){user?.customproperty61.toLowerCase().substring(0,8)}else if(user?.customproperty61!=null && user?.customproperty61?.length()<=8){user?.customproperty61.toLowerCase()}else{if(user?.lastname.toString().replaceAll(' ','').length()<=7){user?.firstname?.substring(0,1)+user?.lastname.substring(0,user?.lastname.length())}else{user?.firstname().substring(0,1)+user?.getLastname().substring(0,7)}}}\",\"Email\":\"${user.email!=null?user.email:''}\",\"CompanyName\": \"${user.companyname!=null?user.companyname:''}\",\"CommunityNickname\": \"${user?.customproperty60.concat('.xxx')}\",\"EmailEncodingKey\": \"UTF-8\",\"Country\": \"${if (task.source == 'PROVRULE' && task?.tasktype==12) {account?.customproperty24} else if(requestAccessAttributes.get('marketValue').toString()=='GLOBAL' && requestAccessAttributes.get('persona').toString()=='Customer Care OC') 'Germany' else if(requestAccessAttributes.get('marketValue').toString()=='GLOBAL' && requestAccessAttributes.get('persona').toString()=='Global NBA Manager') 'Switzerland' else if(requestAccessAttributes.get('marketValue').toString()=='GLOBAL') 'France' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='AT') 'Austria' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='AL') 'Albania' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='BG') 'Bulgaria' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='BA') 'Bosnia and Herzegovina' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='CA') 'Canada' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='CH') 'Switzerland' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='CO') 'Colombia' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='DE') 'Germany' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='DK') 'Denmark' else if(requestAccessAttributes.get('marketValue').toString().substring(0,2)=='ES') 'Spain' else ''}\"}",
            "httpHeaders": {
                "Authorization": "${access_token}",
                "Accept": "application/json"
            },
            "httpContentType": "application/json",
            "successResponses": {
                "statusCode": [
                    201,
                    200,
                    204
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    400,
                    403,
                    401,
                    404,
                    409,
                    501,
                    500
                ]
            }
        }
    ]
}

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