Skip to main content

Hi Fresh community,

we are using Freshservice and are currently working with our HR department to get them as business agents into the system.

Everything is working well for them, there is just one big thing they need.

Due to the HR matters having to be specially protected, they asked about automatically deleting attachments after the ticket has been closed, so no one is able to access them anymore.

Having to manually delete the attachments would be tiresome and not feasible with the amount of tickets they get.

Is there an easy way to automatize this and has anyone tried this already?

From my perspective in regard to the GDPR laws it should be standard in the system but I could not find any information on it.

Thank you all in advance for your help.

There is an API control to delete an attachment.

Looping to find multiple attachments on a ticket may be tricky… https://api.freshservice.com/#delete_a_ticket_attachment 

 

If no one else comes up with something during the day I will take a look at how one could do it later. But it may need something extra beyond fresh or an ugly workflow. 


Hi.

You may try to create a workflow when the status changes to closed, in which you perform a web request using the API for Deleting attachments of tickets:

Service Desk API for Developers | Freshservice

 

Hope this helps.

 


Regards,


Hi.

You may try to create a workflow when the status changes to closed, in which you perform a web request using the API for Deleting attachments of tickets:

Service Desk API for Developers | Freshservice

 

Hope this helps.

 


Regards,

Hi,

the issue with that is only finding out the id of the attachment to delete it.

 

I am currently as far as being able to get the information in an array, now I just need to find a way to use all values from this array in the web request when trying to delete the attachments.


Hi again,

 

thanks to the support of Fresh I was able to resolve it.

 

I will just put it in here again so someone may find it if needed.

 

Here is our Flow:

It will always get triggered when the status is set to closed.

First we get the ticket information via web request from the Freshservice API.

It contains the attachment ids we need to delete them.

make sure to use the numeric Ticket ID as otherwise it won’t work.

To be able to use the data from the Web request we need to parse the JSON.

Make sure to add more strings if needed to be able to use the individual ids of the attachments.

After that we check whether there are attachments filled in.

We then do a web request to delete the attachment we found.

Here again, make sure to use the numeric Ticket ID for the request.

After that you can endlessly spin the check and deletion of attachments, depends on how many you get or usually have.

 

We also send a note to the ticket so an agent coming back at a later stage does not wonder why there are no attachments anymore.