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

If else condition in createTicket Json

agupta1
New Contributor III
New Contributor III

Hi All,

We are using the below if else condition for ticket creation and it was working fine before we upgraded to 23.5 version but right now it just bypasses the if condition and irrespective of anything it is always passing the else value. Any suggestion on how to resolve this?

{
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": "xxx",
"httpMethod": "xxx",
"httpParams": "{\"ticket\":[{\"eeid_c\":\"${user.employeeid}\",\"Subject\":\"${if((reqAttrs?.ApplicationType)=='Admin Right - MAC'){endpoint.customproperty1 +' ' + user.firstname +' ' + user.lastname} else {endpoint.customproperty6+' ' +user.firstname+' ' +user.lastname}}\", \"Cust_Category_c\":\"${if((reqAttrs?.ApplicationType)=='Admin Right - MAC'){endpoint?.customproperty2} else{endpoint?.customproperty7}}\", \"Item_c\":\"${if((reqAttrs?.ApplicationType)=='Admin Right - MAC'){endpoint?.customproperty3}else{endpoint?.customproperty8}}\", \"Cust_Type_c\":\"${if((reqAttrs?.ApplicationType)=='Admin Right - MAC'){endpoint?.customproperty4} else{endpoint?.customproperty9}}\", \"Description\":\"${if((reqAttrs?.ApplicationType)=='Admin Right - MAC'){endpoint?.customproperty5}else{endpoint?.customproperty10}}\"}]}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"ticketidPath": "CaseNumber",
"successResponses": {
"statusCode": [
200,
201
]
}
}]
}

 

 

1 REPLY 1

khalidakhter
Saviynt Employee
Saviynt Employee

Hi @agupta1 

You can use Account Column customproperty populating in the Dynamic Attribute at the endpoint level and then you will be able to access its value in your create ticket JSON for now.
Sample: 

{
  "call": [
    {
      "name": "call1",
      "connection": "acctAuth",
      "url": "xxx",
      "httpMethod": "xxx",
      "httpParams": "{\"ticket\":[{\"eeid_c\":\"${user.employeeid}\",\"Subject\":\"${if((reqAttrs?.customproperty20)=='Admin Right - MAC'){endpoint.customproperty1 +' ' + user.firstname +' ' + user.lastname} else {endpoint.customproperty6+' ' +user.firstname+' ' +user.lastname}}\", \"Cust_Category_c\":\"${if((reqAttrs?.customproperty20)=='Admin Right - MAC'){endpoint?.customproperty2} else{endpoint?.customproperty7}}\", \"Item_c\":\"${if((reqAttrs?.customproperty20)=='Admin Right - MAC'){endpoint?.customproperty3}else{endpoint?.customproperty8}}\", \"Cust_Type_c\":\"${if((reqAttrs?.customproperty20)=='Admin Right - MAC'){endpoint?.customproperty4} else{endpoint?.customproperty9}}\", \"Description\":\"${if((reqAttrs?.customproperty20)=='Admin Right - MAC'){endpoint?.customproperty5}else{endpoint?.customproperty10}}\"}]}",
      "httpHeaders": {
        "Authorization": "${access_token}",
        "Accept": "application/json"
      },
      "httpContentType": "application/json",
      "ticketidPath": "CaseNumber",
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

Also as you mentioned that the same dynamic attribute was working prior to the 23.5 version then, I will recommend creating a Service ticket to Saviynt with the evidence that the same was working earlier.