Skip to main content
Question

Deleting multiple attachments from a ticket after it is closed through a web request

  • August 5, 2025
  • 6 replies
  • 58 views

Forum|alt.badge.img

Hi Team, 

I am trying to work on a use case to delete attachments from a ticket once it has been closed for 30 days. I was able to delete one attachment but cannot figure out a way to create a loop for that attachment array and it runs till it traverses the complete array with all attachment ids.

I understand the logic but dont know how to get it in a json to do the job :)


Any help is greatly appreciated.

Thanks,

NB

6 replies

Roxwell
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • August 5, 2025

This is the biggest limitation of Freshservice, Looping… we’re all waiting on it, 

 

The only method at the moment, is to run the same actions multiple times, 3,4,5 to be sure you got them all.  

You cannot say “Repeat this based on the number of items in the array”..

If someone else has a better answer I’d be keen to hear it. 


Forum|alt.badge.img+4
  • Top Contributor ⭐
  • August 6, 2025

Hey,

 

we had the same issue, basically what we did is copy pasting the same events as mentioned by ​@Roxwell:
 

 

So far I do not know about any other option unfortunately.


Roxwell
Top Contributor ⭐
Forum|alt.badge.img+9
  • Top Contributor ⭐
  • August 6, 2025

Hi Team, 

I am trying to work on a use case to delete attachments from a ticket once it has been closed for 30 days. I was able to delete one attachment but cannot figure out a way to create a loop for that attachment array and it runs till it traverses the complete array with all attachment ids.

I understand the logic but dont know how to get it in a json to do the job :)


Any help is greatly appreciated.

Thanks,

NB

 GOOD NEWS - LOOPS IS Q4!! 


Forum|alt.badge.img
  • Author
  • Apprentice
  • August 6, 2025

this is great news…:)


freewheelie
Contributor
Forum|alt.badge.img+1
  • Contributor
  • August 12, 2025

Loops are essential in automations, and it’s strange that Fresh does not have them in flows...yet. My workaround is to call a python script I have hosted in AWS, and process the data that way (also call Fresh API if required)


Hamza 123
Community Debut
  • Community Debut
  • August 12, 2025

If you need to delete multiple attachments from a closed ticket via a web request, you’ll likely have to use the API’s delete or update endpoint, as most systems lock tickets after closure. Check if your platform supports bulk attachment deletion or requires reopening the ticket first. You may need to loop through each attachment ID in your request. Also, verify your user permissions—some APIs only allow deletion by admins or the original uploader.