04/12/2022 01:22 PM
We have an endpoint that creates remedy tickets. Is there a way by which we can stop/exclude creating tickets for remove account task type?
04/12/2022 03:11 PM
Mareeta,
Could you provide us a brief write up on your integration on how the remedy tickets gets created for the tasks ?
Regards,
Avinash Chhetri
04/12/2022 03:11 PM
This is a disconnected application and only creates Remedy tickets. The endpoint is having a rest connection. we are making use of the CreateTicketJSON of REST Connector to create the tickets. Right now, for any task that is created for the endpoint, a ticket is created. I am looking for suggestions if it is possible to exclude/include creating tickets based on task type within the CreateTicketJSON?
04/12/2022 03:11 PM
Mareeta,
Are you using the Remedy Conector as discussed in the lik below ?
https://saviynt.freshdesk.com/a/solutions/articles/43000462993
Regards,
Avinash Chhetri
04/12/2022 03:11 PM
Hi Avinash, No we are using a rest connector - CreateTicketJSON
REST Connector Guide : Customer Portal (freshdesk.com)
I am following the examples provided and tried different ways but nowhere with this so far.
What I am looking for is if tasktype==3 then create the ticket else not. Kindly help
04/12/2022 03:11 PM
Mareeta,
Can you post the contents of the CreateTicket JSON from your connection ?
Please ensure that you mask all sensitive information before posting.
Regards,
Avinash Chhetri
04/12/2022 03:11 PM
This is the one I tried last. but getting error 'Error in getting Ticket Number. Response: null'
This works fine without the condition.
{
"call":[
{
"name":"call1",
"connection":"userAuth",
"url":"remedy url",
"httpMethod":"POST",
"httpParams":"($task.tasktype==3)'{\"assignedGroup\":\"${task.endpoint.customproperty1}\",\"assignedSupportCompany\":\"XYZ\",\"company\":\"XYZ\",\"impact\":\"${task.endpoint.customproperty2}\",\"contactId\":\"${user.systemUserName.toLowerCase()}\",\"alternateContactId\":\"abc\",\"requestorId\":\"abc\",\"incidentType\":\"User Request\",\"status\":\"New\",\"template\":\"${task.endpoint.customproperty3}\",\"notes\":\"Requesting Associate Full Name: $user.firstname $user.lastname\",\"operationalCategorizationTier1\":\"Modify\",\"reportedSource\":\"Internal\",\"summary\":\"Request for: ${task.endpoint.displayName}\",\"targetDate\":\"NULL\",\"urgency\":\"${task.endpoint.customproperty4}\"}':'{}'",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json",
"ticketidPath":"incidentId",
"successResponses":{
"statusCode":[
200,
201
]
}
}
]
}
04/12/2022 03:11 PM
It seems to me that your logic is correct, however the response it is getting back is an issue since you are not creating any ticket and getting a null in response under ticketidPath.
Regards,
Avinash Chhetri
05/24/2022 08:48 PM
Mareeta,
The Syntax used under httpParams seems incorrect. Once the script is started with ${} and you are using if else condition inside it, the user attributes should not be used as ${user.username}. It will be considered as a script inside a script, the attributes wont resolve. We need to render the content as mentioned in the sample below.
Attaching a sample for your reference:
"httpParams": "${(task?.tasktype.toString().equals('14'))?'{\"cmdb_ci\": \"XXXXXX\",\"short_description\": \"Saviynt - VRS Suspension - ' + user.username + '\",\"description\": \"PLEASE SUSPEND/DELETE THE USER - NO NEED TO DELIVER THE INFORMATION TO THE END USER. Thank You. Please suspend / delete the account for ' + user.lastname + ', ' + user.firstname + ' ======= User ID to Suspend / Delete : ' + user.username + ' System: VRS Please remove all the Associated Entitlements of this user. \",\"opened_by\": \"-Svc-gbl-SNOW-Prd\",\"u_requested_for\": \"-Svc-gbl-SNOW-Prd\",\"priority\":\"4\"}':'{\"cmdb_ci\": \"XXXXXX\",\"short_description\": \"Saviynt - VRS Access Request - ' + user.username + '\",\"description\": \"PLEASE COMPLETE THE REQUEST - NO NEED TO DELIVER THE INFORMATION TO THE END USER. Thank You.Please ensure that the accounts are setup as described below for ' + user.lastname + ', ' + user.firstname + ' ======= Saviynt Request ID: ' + (task?.requestKey?.processinstanceid?.indexOf('.') >= 0 ? task.requestKey.processinstanceid.substring(task.requestKey.processinstanceid.indexOf('.') + 1) : '') + ' User ID: ' + user.username + ' System: VRS FINAL ENTITLEMENTS FOR USER AS BELOW ======== ACTION REQUIRED AS FOLLOWS: ' + allEntitlementsValues + ' \",\"opened_by\": \"-Svc-gbl-SNOW-Prd",\"u_requested_for\":\"' + user.username + '\",\"priority\":\"4\"}'}",
Kindly revisit your syntax aligning to the above mentioned one. The JSON should work.