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

Create ticket JSON

Naveen_Talanos
Regular Contributor II
Regular Contributor II

Hi Experts,

Please could you help?

I have to pass below httpParams to Service Now in CreateTicket JSON. Could you please help and guide as what variables can I use for ENDPOINT_KEY, ENTITLEMENT_KEY, ENTITLEMENT_TYPE, ENTITLEMENT_DISPLAY_NAME and ENTITLEMENT_NAME.

Also, from where do we get the list of variables that we can use in various JSONs

We use Saviynt just for recertifications, so task will have one entitlement at a time.

 

 

{
  "call": [
    {
      "name": "call1",
      "connection": "userAuth",
      "url": "https://client.service-now.com/api/12/saviynt",
      "httpMethod": "POST",
      "httpParams": "{\"user\": {\"first_name\": \"$user.firstname\",\"last_name\": \"$user.lastname\",\"email\": \"$user.email\",\"saviynt_user\": \"$user.username\"},\"application\": {\"display_name\": \"$endpoint.displayname\",\"name\": \"$endpoint.endpointname\",\"saviynt_id\": \"ENDPOINT_KEY\"},\"entitlements\": {\"saviynt_id\": \"ENTITLEMENT_KEY\",\"entitlement_types\": \"ENTITLEMENT_TYPE\",\"display_name\": \"ENTITLEMENT_DISPLAY_NAME\",\"name\": \"ENTITLEMENT_NAME\"},\"action_date\": \"31/07/2024\",  \"action\": \"delete\"}",
      "httpHeaders": {
        "Authorization": "${access_token}"},
      "httpContentType": "application/json",
      "ticketidPath": "result.request_item",
      "ticketStatusPath": "result.status",
      "ticketStatusValue": [
        "success",
        "OPEN",
        "open"      ],
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

 

 

  @fouriefb 

Regards

Naveen

[This post has been edited by a Moderator. We discourage the @ mention of other forum users or employees unless they have already involved themselves on the forum post.]

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

ENDPOINT_KEY, ENTITLEMENT_KEY, ENTITLEMENT_TYPE, ENTITLEMENT_DISPLAY_NAME and ENTITLEMENT_NAME.

${arstasksObj?.endpoint}

${arstasksObj?.entitlementValuekey}

${arstasksObj?.entitlementValuekey?.entitlementTypeKey?.entitlementName}

${arstasksObj?.entitlementValuekey?.displayName}

${arstasksObj?.entitlementValuekey?.entitlementValue}

 

 

 

 


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

Thanks for your reply @rushikeshvartak 
I have added the variables but it is printing variables back in logs instead of values. I have seen this behaviour when one of the variables is incorrect. Could you please help and check if I have added something wrong?

{
  "call": [
    {
      "name": "call1",
      "connection": "userAuth",
      "url": "https://client.service-now.com/api/quich/saviynt",
      "httpMethod": "POST",
    "httpParams":"{\"user\": {\"first_name\": \"$user.firstname\",\"last_name\": \"$user.lastname\",\"email\": \"$user.email\",    \"saviynt_user\": \"$user.username\"},\"application\": {\"display_name\": \"$endpoint.displayname\",\"name\": \"$endpoint.endpointname\",\"saviynt_id\": \"${arstasksObj?.endpoint}\"},\"entitlements\": {\"saviynt_id\": \"${arstasksObj?.entitlementValuekey}\",\"entitlement_types\": \"${arstasksObj?.entitlementValuekey?.entitlementTypeKey?.entitlementName}\",\"display_name\": \"${arstasksObj?.entitlementValuekey?.displayName}\",\"name\": \"${arstasksObj?.entitlementValuekey?.entitlementValue}\"},\"action_date\": \"31/07/2024\",\"action\": \"delete\"}",
      "httpHeaders": {
        "Authorization": "${access_token}"},
      "httpContentType": "application/json",
      "ticketidPath": "result.request_item",
      "ticketStatusPath": "result.status",
      "ticketStatusValue": [
        "success",
        "OPEN",
        "open"      ],
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

 

Printed in logs

{"user":{"first_name":"$user.firstname","last_name":"$user.lastname","email":"$user.email","saviynt_user":"$user.username"},"application":{"display_name":"$endpoint.displayname","name":"$endpoint.endpointname","saviynt_id":"${arstasksObj?.endpoint}"},"entitlements":{"saviynt_id":"${arstasksObj?.entitlementValuekey}","entitlement_types":"${arstasksObj?.entitlementValuekey?.entitlementTypeKey?.entitlementName}","display_name":"${arstasksObj?.entitlementValuekey?.displayName}","name":"${arstasksObj?.entitlementValuekey?.entitlementValue}"},"action_date":"31/07/2024","action":"delete"}]]

 Regards

Naveen

  • Maybe one of the variable is not working try one by one

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

Hi @rushikeshvartak 

Getting below error:
Error in getDynamicBindString: You have configured an invalid attribute 'entitlementValuekey' with [createTicketJSON call1 httpParams] for class 'Ars Tasks', please check the input request.

Naveen_Talanos_0-1724172296153.png

Please could you guide?

Regards

Naveen


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

Hi @rushikeshvartak 

I have used the below variables and are giving me correct values

ENDPOINT_KEY: ${endpoint.id}

ENTITLEMENT_KEY: ${entitlementValuesObj.id}

ENTITLEMENT_TYPE: ${entitlementValuesObj.entitlementtypekey}

ENTITLEMENT_DISPLAY_NAME: ${entitlementValuesObj.entitlement_value}

ENTITLEMENT_NAME: ${entitlementValuesObj.entitlement_value}

Added full JSON as well:

{
  "call": [
    {
      "name": "call1",
      "connection": "userAuth",
      "url": "https://client.service-now.com/api/quich/saviynt",
      "httpMethod": "POST",
    "httpParams":"{\"user\": {\"first_name\": \"$user.firstname\",\"last_name\": \"$user.lastname\",\"email\": \"$user.email\",\"saviynt_user\": \"$user.username\"},\"application\": {\"display_name\": \"$endpoint.endpointname\",\"name\": \"$endpoint.endpointname\",\"saviynt_id\": \"${endpoint.id}\"},\"entitlements\": {\"saviynt_id\": \"${entitlementValuesObj.id}\",\"entitlement_types\": \"${entitlementValuesObj.entitlementtypekey}\",\"display_name\": \"${entitlementValuesObj.entitlement_value}\",\"name\": \"${entitlementValuesObj.entitlement_value}\"},\"action_date\": \"${new java.text.SimpleDateFormat('dd/MM/yyyy').format(task?.startDate)}\",\"action\": \"${if(task.tasktype==1){'Create'}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Delete'}else if(task.tasktype==2 && task.source=='REQUEST'){'Remove'} else if(task.tasktype==2 && task.source=='ANALYTICS_V2'){'Remove'} else if(task.tasktype==2 && task.source=='CERTIFICATION'){'Remove'}else if(task.tasktype==3){'New Account'}else if(task.tasktype==6){'Enable Account'}else if(task.tasktype==14){'Suspend'}else{task.tasktype}}\"}",
      "httpHeaders": {
        "Authorization": "${access_token}"},
      "httpContentType": "application/json",
      "ticketidPath": "result.request_item",
      "ticketStatusPath": "result.status",
      "ticketStatusValue": [
        "success",
        "OPEN",
        "open"      ],
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

 Thanks a lot for your help.

Regards,
Naveen

Please click the 'Accept As Solution' button on the reply (or replies) that best answers your original question and hit 'Kudos' button 👍.


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