Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/20/2024 08:24 AM - last edited on 08/20/2024 09:04 AM by Sunil
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
]
}
}
]
}
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.]
Solved! Go to Solution.
08/20/2024 08:27 AM - edited 08/20/2024 08:28 AM
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}
08/20/2024 08:59 AM
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
08/20/2024 09:27 AM
08/20/2024 09:45 AM
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.
Please could you guide?
Regards
Naveen
08/20/2024 09:55 AM
${entitlementValuesObj.entitlementTypekey} |
08/21/2024 08:07 AM
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
08/21/2024 08:09 AM
✅Please click the 'Accept As Solution' button on the reply (or replies) that best answers your original question and hit 'Kudos' button 👍.