Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/13/2024 12:35 AM
Hi All,
We are trying to raise request for servicenow and ticket is getting created, but the task is not getting provisioned with below error.
Error: Error in getting Ticket Number. Response: {"id":"IMS0XXX"}
Create ticket JSON:
{ "accountIdPath": "call1.message.Body.Token", "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX", "responseColsToPropsMap": { "customproperty1": "call1.message.Body.Token~#~char", "comments": "call1.message.Message~#~char" }, "call": [ { "name": "Groups", "connection": "userAuth", "url": "https://xxxx/servicemanagement/v1/tickets?type=ServiceRequest", "httpMethod": "POST", "httpParams": "{\"shortDescription\":\"${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} Request - ${task.entitlement_valueKey.entitlement_value} \",\"category\":\"Access\",\"subCategory\":\"Access request / removal\",\"description\":\"A request for Access Entitlements has been raised in the Access Management System with the following details. If required, please use the Request ID provided to view further details of this request within the Access Management System : https://*******/ECM/workflowmanagement/requesthome?menu=1 \\\n \\\n Access Requested For : ${user.lastname ?: ''}, ${user.preferedFirstName ?: ''} (${user.username ?: ''}) \\\n Request Type : ${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} \\\n Requested Entitlement(s) : ${task.entitlement_valueKey.entitlement_value} \\\n Requested By : ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).lastname}, ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).preferedFirstName} (${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}) \\\n Specific Instructions : ${task.entitlement_valueKey.customproperty3 ?: ''} \\\n Access Management Request ID : ${task?.requestKey?.processinstanceid?.indexOf('.') >= 0 ? task.requestKey.processinstanceid.substring(task.requestKey.processinstanceid.indexOf('.') + 1) : ''}\",\"caller\":\"${user.username ?: ''}\",\"assignmentGroup\":\"${task.entitlement_valueKey.customproperty2}\",\"type\":\"request\",\"openedBy\":\"${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}\"}", "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json", "Accept": "application/json", "X-Workato-Access-Profile-Key": "***************" }, "httpContentType": "application/json", "ticketidPath": "number", "responses": { "successResponses": { "statusCode": { "200": { "responseMessage": "Successfully updated" }, "201": { "responseMessage": "Successfully updated" }, "202": { "responseMessage": "Successfully updated" }, "203": { "responseMessage": "Successfully updated" }, "204": { "responseMessage": "Successfully updated" } } }, "unsuccessResponses": { "statusCode": { "400": { "responseMessage": "Operation Failed" }, "401": { "responseMessage": "Operation Failed" }, "403": { "responseMessage": "Operation Failed" }, "404": { "responseMessage": "Operation Failed" }, "405": { "responseMessage": "Operation Failed" }, "500": { "responseMessage": "Operation Failed" }, "501": { "responseMessage": "Operation Failed" } } } } } ] }
Ticket Status JSON:
{ "accountIdPath": "call1.message.Body.Token", "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX", "responseColsToPropsMap": { "customproperty1": "call1.message.Body.Token~#~char", "comments": "call1.message.Message~#~char" }, "call": [ { "name": "Groups", "connection": "userAuth", "url": "https://xxxx/servicemanagement/v1/tickets/${ticketID}", "httpMethod": "GET", "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json", "Accept": "application/json", "X-Workato-Access-Profile-Key": "********************" }, "httpContentType": "application/json", "ticketStatusPath": "serviceNowStatus", "ticketStatusValue": [ "Closed Complete" ], "disContinueStatusValue": [ "Closed Incomplete", "Closed Skipped" ], "successResponses": [ { "statusCode": [ 200 ] } ] } ] }
Regards
Sridhar
08/13/2024 01:03 AM
Hi @sridhar , is it working from postman??
08/13/2024 01:12 AM
Hi NM, it's working from Postman.
08/13/2024 01:13 AM
In both json it should be ticketidPath and not accountIdPath
08/13/2024 08:20 PM
Hi Rushikeshvartak,
Still i can see same error(Error in getting Ticket Number. Response: {"id":"IMS0XXXX"})After updating ticketidPath in both Json.
Regards
Sridhar
08/13/2024 08:35 PM
Your JSON was overall wrong
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxx/servicemanagement/v1/tickets?type=ServiceRequest",
"httpMethod": "POST",
"httpParams": "{\"shortDescription\":\"${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} Request - ${task.entitlement_valueKey.entitlement_value} \",\"category\":\"Access\",\"subCategory\":\"Access request / removal\",\"description\":\"A request for Access Entitlements has been raised in the Access Management System with the following details. If required, please use the Request ID provided to view further details of this request within the Access Management System : https://*******/ECM/workflowmanagement/requesthome?menu=1 \\\n \\\n Access Requested For : ${user.lastname ?: ''}, ${user.preferedFirstName ?: ''} (${user.username ?: ''}) \\\n Request Type : ${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} \\\n Requested Entitlement(s) : ${task.entitlement_valueKey.entitlement_value} \\\n Requested By : ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).lastname}, ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).preferedFirstName} (${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}) \\\n Specific Instructions : ${task.entitlement_valueKey.customproperty3 ?: ''} \\\n Access Management Request ID : ${task?.requestKey?.processinstanceid?.indexOf('.') >= 0 ? task.requestKey.processinstanceid.substring(task.requestKey.processinstanceid.indexOf('.') + 1) : ''}\",\"caller\":\"${user.username ?: ''}\",\"assignmentGroup\":\"${task.entitlement_valueKey.customproperty2}\",\"type\":\"request\",\"openedBy\":\"${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Workato-Access-Profile-Key": "***************"
},
"httpContentType": "application/json",
"ticketidPath": "id",
"ticketStatusPath": "result.status",
"ticketStatusValue": [
"success",
"OPEN",
"open"
],
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
08/13/2024 08:46 PM
Hi @rushikeshvartak ,
This is the updated JSON, please review once.
{ "accountIdPath": "call1.message.Body.Token", "dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX", "responseColsToPropsMap": { "customproperty1": "call1.message.Body.Token~#~char", "comments": "call1.message.Message~#~char" }, "call": [ { "name": "Groups", "connection": "userAuth", "url": "https://test/servicemanagement/v1/tickets?type=ServiceRequest", "httpMethod": "POST", "httpParams": "{\"shortDescription\":\"${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} Request - ${task.entitlement_valueKey.entitlement_value} \",\"category\":\"Access\",\"subCategory\":\"Access request / removal\",\"description\":\"A request for Access Entitlements has been raised in the Access Management System with the following details. If required, please use the Request ID provided to view further details of this request within the Access Management System : https://test.saviyntcloud.com/ECM/workflowmanagement/requesthome?menu=1 \\\n \\\n Access Requested For : ${user.lastname ?: ''}, ${user.preferedFirstName ?: ''} (${user.username ?: ''}) \\\n Request Type : ${if (task.tasktype == 1) {'Add Access'} else {'Remove Access'}} \\\n Requested Entitlement(s) : ${task.entitlement_valueKey.entitlement_value} \\\n Requested By : ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).lastname}, ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).preferedFirstName} (${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}) \\\n Specific Instructions : ${task.entitlement_valueKey.customproperty3 ?: ''} \\\n Access Management Request ID : ${task?.requestKey?.processinstanceid?.indexOf('.') >= 0 ? task.requestKey.processinstanceid.substring(task.requestKey.processinstanceid.indexOf('.') + 1) : ''}\",\"caller\":\"${user.username ?: ''}\",\"assignmentGroup\":\"${task.entitlement_valueKey.customproperty2}\",\"type\":\"request\",\"openedBy\":\"${com.saviynt.ecm.identitywarehouse.domain.Users.get(task.requestKey.requestor).username}\"}", "httpHeaders": { "Authorization": "${access_token}", "Content-Type": "application/json", "Accept": "application/json", "X-Workato-Access-Profile-Key": "XXXX" }, "httpContentType": "application/json", "ticketidPath": "result.request_number", "ticketStatusPath": "result.state", "ticketStatusValue": [ "Open", "OPEN", "open" ], "responses": { "successResponses": { "statusCode": { "200": { "responseMessage": "Successfully updated" }, "201": { "responseMessage": "Successfully updated" }, "202": { "responseMessage": "Successfully updated" }, "203": { "responseMessage": "Successfully updated" }, "204": { "responseMessage": "Successfully updated" } } }, "unsuccessResponses": { "statusCode": { "400": { "responseMessage": "Operation Failed" }, "401": { "responseMessage": "Operation Failed" }, "403": { "responseMessage": "Operation Failed" }, "404": { "responseMessage": "Operation Failed" }, "405": { "responseMessage": "Operation Failed" }, "500": { "responseMessage": "Operation Failed" }, "501": { "responseMessage": "Operation Failed" } } } } } ] }
08/13/2024 08:57 PM
Use json shared above
08/19/2024 04:04 AM
Hi Rushikeshvartak,
Thank you for the help, still i'm getting same error under provisioning comments(Error in getting Ticket Number. Response: null), i'm able to see request and with the status.
Regards
Sridhar
08/19/2024 06:21 AM
Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️