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

Task Discontinued Error JSON body

HichamElk
Regular Contributor
Regular Contributor

Hello Team,

We have tasks for creating account in one application that are working well.

For one user in particular, the task is discontinued with the following error 

 

{"call3":{"headers":null,"message":{"responseMessage":"Request Media Type[application/json] Error! Request Body is not JSON format."},"statusCode":400,"description":null,"status":"Failed"},"call4":{"headers":"xxx","message":{"resultMsg":"Regularization request received"},"statusCode":202,"description":null,"status":"Success"},"message":{"resultMsg":"Regularization request received"}};Ticket Number=null;Ticket Number=null;Ticket Number=null

 

When checking the call3 on the createTicketJson in connexion, JSON seems ok without error. 

We can't find where the error comes from. 

This is our CreateTicketJSON 

 

{
  "ticketidPath": "call3.message.transaction_id",
  "call": [
    {
      "name": "call3",
      "connection": "userAuth",
      "url": "https://apim.api.fr.xxx/user",
      "httpMethod": "POST",
      "httpParams": "{\"iam_task_id\":\"${task.id}\",\"user_app_id\": \"${task.accountName}\",\"user_iam_id\": \"${user.employeeid}\",\"appTrigram\":\"${endpoint.endpointname}\",\"userStatus\":\"${if(task.tasktype==6){'active'}else if(task.tasktype==14||(task.tasktype==2&&allEntitlementsValues=='')||task.accountKey?.status=='Manually Suspended'||task.accountKey?.status=='Decomission Inactive'||task.accountKey?.status=='Suspended from Import Service'||task.accountKey?.status=='Inactive'){'inactive'}else {'active'}}\",\"lastModified\":\"${user.lastsyncdate}\",\"basicInfo\":{\"userName\":\"${user.systemUserName}\",\"familyName\":\"${user.lastname}\",\"givenName\":\"${user.firstname}\",\"emails\":[\"${user.email}\"]${if(task.tasktype==3||task.tasktype==1){requestAccessAttributes.phonenumber!=null&&requestAccessAttributes.phonenumber.trim()!=''?',\"phoneNumbers\":\"'+requestAccessAttributes.phonenumber.replaceAll(\" \",\"\")+'\"':''}},\"officeName\":${user.location==null?'null':'\"'+user.location+'\"'},\"country\":\"${user.customproperty10}\"},\"additionalUserInfo\":[{\"key\":\"perimetre\",\"value\":${if(task.tasktype==14 || task.tasktype==6 || task.tasktype==2){'null'} else if (task.source=='REQUEST') {'\"'+requestAccessAttributes.perimeter+'\"'} else {task.accountKey.customproperty1 == null?'null':'\"'+task.accountKey.customproperty1+'\"'}}}${if(task.tasktype==14 || task.tasktype==6 || task.tasktype==2){''} else if (task.source=='REQUEST') {requestAccessAttributes.import=='TRUE'?',{\"key\":\"droits\",\"value\":\"30\"},{\"key\":\"droits\",\"value\":\"31\"}':''} else {task.accountKey.customproperty2=='TRUE'?',{\"key\":\"droits\",\"value\":\"30\"},{\"key\":\"droits\",\"value\":\"31\"}':''}}${if(task.tasktype==14 || task.tasktype==6 || task.tasktype==2){''} else if (task.source=='REQUEST') {requestAccessAttributes.firstsign=='TRUE'?',{\"key\":\"droits\",\"value\":\"20\"}':requestAccessAttributes.secondsignature=='TRUE'?',{\"key\":\"droits\",\"value\":\"20\"}':''} else {task.accountKey.customproperty7=='TRUE'?',{\"key\":\"droits\",\"value\":\"20\"}':task.accountKey.customproperty5=='TRUE'?',{\"key\":\"droits\",\"value\":\"20\"}':''}},{\"key\":\"preuve_identite\",\"value\":${if(task.tasktype==14 || task.tasktype==6 || task.tasktype==2){'null'} else {user.phonenumber==null?'\"7\"':'\"8\"'}}}]${if(taskIds != null && taskIds.size()>0){String result='';String result2='';String result3='';ArrayList arr = new ArrayList(taskIds);arr.eachWithIndex{val, idx ->(com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==1&&com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey!=null)?result=result.concat('{\"name\":\"'+com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value+'\"},'):(com.saviynt.ecm.task.ArsTasks.get(val)?.tasktype==2&&com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey!=null)?result2=result2.concat('{\"name\":\"'+com.saviynt.ecm.task.ArsTasks.get(val)?.entitlement_valueKey?.entitlement_value+'\"},'):'';};if (result.length()!=0){result=',\"roles_add\":['+result.substring(0, result.length() - 1)+']';};if(result2.length()!=0){result2=',\"roles_remove\":['+result2.substring(0, result2.length() - 1)+']';};if (result.length()!=0 && result2.length()!=0){result3=result+result2;}else {result3=result+result2;};return result3;}else{return '';}}}",
      "httpHeaders": {
        "Authorization": "${access_token}"
      },
      "httpContentType": "application/json",
      "successResponses": {
        "statusCode": [
          200,
          201,
          202
        ]
      }
    }
  ]
}

 

 

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

This can be data issue with user . Did you tried from postman for that user ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

There is sadly no Postman collection to try it. Moreover, we can't try in dev environment to recreate the task because the application is now disconnected from dev environment. Application is only connected to prod

Check dynamic user information which can cause issue


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Can't find anything special in dynamic user information. 
Is it possible to find the particular attribute that causes the problem with the JSON creation in logs ? 

No, You need to remove one by one and figure out


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Please share working JSON to help community


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.