Canceling approval requests

I’ve already reached out to Freshworks support for assistance with this problem, but unfortunately, we haven’t been able to resolve it. I’m hoping that our community might have some innovative solutions to offer.

I’m looking for a way to distinguish between manual and automatic cancellations of approval requests, or alternatively, to determine if a ticket has been deleted or marked as spam. The reason behind this is that I’ve set up a workflow to manage situations where one of our agents cancels an approval request. It currently works well when an agent manually cancels the request, which is ideal. However, it also triggers when a ticket is deleted, which also leads to the cancellation of the approval request.

Hello @Yanivtech ,
If you can’t check who cancels the request with the fields given in the workflow, you can try making an API call in List All Ticket Approvals, then parse the response body and check the last approval if there is more than one.
I think that the most recent elements are always the first in the freshservice arrays, but I’m not sure in this case, I never used this API.
I hope this helps.

Thanks Michele for the idea. I don’t see how I can check any field in the example response to identify how the approval was canceled. However, I did find an interesting field called “Delegatee”. Any idea what it is used for?

Here’s the example response:
{
“approval”: {
“id”: 1,
“created_at”: “2022-12-08T11:52:41Z”,
“updated_at”: “2023-01-09T08:48:23Z”,
“approver_id”: 8,
“approver_name”: “Alexander Schroeder”,
“approval_type”: 1,
“user_id”: 1,
“level”: 2,
“user_name”: “Rolanda Hooch”,
“approval_status”: {
“id”: 3,
“name”: “cancelled”
},
“delegatee”: {
“id”: 29,
“name”: “Ronald Weasley”
},
“email_content”: “

Your Email content


“latest_remark”: “”
}
}

Ticket details can also be retrieved from GET (e.g. https://yaniv.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}) to check the spam or deleted properties to use as conditions in the workflows. Not sure what other conditions are in the workflow as this would be expensive to make for every ticket update.

@Yanivtech I have no clue what that field means, that is for you to find out during testing XD

Maybe I found another solution, can’t you use this event?

How do you perform automatic cancellations? Is it’s an SLA Policy? This condition in the event should capture only the cancellations made by the category you choose.

For the complex solution you have to use the web request node and call the api that I suggested before and copy the response body in a JSON Parser node

and change all the * in the Path column with 0, also change the type in those edited rows to not be Array, like this you should get the most recent approval with all it’s properties.
Then you can use the Condition node to check the approver_name and the approval_status fields.

@Yanivtech this is also an option, but as @rasimm said, if you check every ticket update unconditionally, this can weight your rate limit in different ways depending on your plan.

In this case too you’ll have to use the Web Request and JSON Parser nodes.