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

ServiceNow Integration as ticketing system, issues with Create ticket JSON

NidhiSingh
New Contributor
New Contributor

Hello Experts,

I have integrated ServiceNow as ticketing system with Saviynt and I am trying to create ticket in ServiceNow using Create Ticket JSON. Below is my Create Ticket JSON-

{
"ticketidPath": "call1.message.result.request_number",
  "call": [
    {
      "name": "call1",
      "connection": "userAuth",
      "url": "https://servicenow.com/api/sn_sc/servicecatalog/items/21d09b261bXXXXXXXXba9604b24bcXXX/order_now" ,
      "httpMethod": "POST",
      "httpParams": "{\"sysparm_quantity\":1,\"sysparm_requested_for\":\"50653aae1b8cXXXXbe10fdd91d4bcXXX\",\"variables\":{\"short_description\":\"REMOVE ACCESS:Revoke access request for the application $endpoint.endpointname\",\"description\":\"Remove the entitlements as specified in the variables below. DO NOT REMOVE OR DISABLE THE ACCOUNT.\",\"application_name\":\"$endpoint.endpointname\",\"user_account_id\":\"$account.name\",\"entitlement_type\":\"${entitlementValuesObj.entitlementtypekey}\",\"entitlement\": \"${allEntitlementsValues}\",\"full_name\":\"${user.firstname}${user.lastname}\",\"email\":\"$user.email\",\"gad_username\":\"$user.customproperty1\",\"ars_task_saviynt_reference_ticket\":\"${taskIds}\"}}",
"httpHeaders": {
        "Authorization": "${access_token}"      },
      "httpContentType": "application/json",
      "successResponses":
                {
                    "statusCode": [201]
                }
    }
  ]
}

I need to pass the variables in Variable section to create ticket in SNOW. With above JSON, ticket is getting created but variables are coming as dynamic not fetching the application, user or entitlement details. Can someone help me out with this. Also, if someone can help me with one extra variable I need to pass through- Action type- LEAVER, MOVER, RECERTIFICATION all three use cases will lead to only Revoke access. Thank you.

[This message has been edited by moderator to disable URL hyperlink]

9 REPLIES 9

NidhiSingh
New Contributor
New Contributor
Hello Experts,
Some variables are getting populated now used below JSON. But I am still not able to populate Entitlement type, Entitlement list, Task creation source and Full Name. Can someone suggest binding variables for these 4- Entitlement type, Entitlement list, Task creation source and Full Name.
 
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxxx/api/sn_sc/servicecatalog/items/21d09b261b40965074ba9604b24bcxxx/order_now",
"httpMethod": "POST",
"httpParams": "{\"sysparm_quantity\":1,\"sysparm_requested_for\":\"50653aae1b8c9614be10fdd91d4bcxxx\",\"variables\":{\"short_description\":\"REMOVE ACCESS:Revoke access request for the application ${task?.endpoint?.displayName}\",\"description\":\"Remove the entitlements as specified in the variables below. DO NOT REMOVE OR DISABLE THE ACCOUNT.\",\"application_name\":\"${task?.endpoint?.displayName}\",\"user_account_id\":\"${task?.accountName}\",\"entitlement_type\":\"Profile Name\",\"entitlement\": \"${task?.entitlement_valueKey?.entitlement_value}\",\"full_name\":\"${user?.firstname}\",\"email\":\"${user?.email}\",\"gad_username\":\"${user?.customproperty1}\",\"ars_task_saviynt_reference_ticket\":\"${task.id}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
      "ticketidPath": "result.number",
"successResponses": {
"statusCode": [
201
]
}
}
]
 }
 

Does it working from postman ?


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

yes with static variables

Limit dynamic variable and validate incremental adding dynamic variables


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

Below JSON is working. 
"{\"sysparm_quantity\":1,\"sysparm_requested_for\":\"***\",\"variables\":{\"short_description\":\"Revoke access request for the application ${task?.endpoint?.displayName}\",\"description\":\"Remove the entitlements as specified in the variables below. DO NOT REMOVE OR DISABLE THE ACCOUNT.\",\"revoke_source\":\"${if(task?.source=='CERTIFICATION'){'RECERTIFICATION'}else(task?.source=='PROVRULE'){'LEAVER'}}\",\"application_name\":\"${task?.endpoint?.displayName}\",\"user_account_id\":\"${task?.accountName}\",\"entitlement_type\":\"${entitlementValuesObj.entitlementtypekey}\",\"entitlement\": \"${allEntitlementsValues}\",\"full_name\":\"${user?.firstname}${user?.lastname}\",\"email\":\"${user?.email}\",\"gad_username\":\"${user?.customproperty1}\",\"ars_task_saviynt_reference_ticket\":\"${task.id}\"}}",

I tried Full name JSON as \"full_name\":\"${user?.firstname}' ' ${user?.lastname}\", for space between First name and last name. It's throwing error. Can someone help me resolve it.

Full name JSON as \"full_name\":\"${user?.firstname}' ' ${user?.lastname}\", for space between First name and last name. It's throwing error. Can someone help me resolve it.

"full_name": "${user?.firstname} ${user?.lastname}"


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

Worked, thank you