zip all attachments to a record, add the zip as an attachment and delete the original attachments?

stevemac
Tera Guru

We are approaching the 4TB limit on our instances and do not want to pay for an increase.  The biggest table is sys_attachment_doc.  As such we are looking at options to reduce the size.  In consideration are

  1. Delete attachments for some older records
  2. Extract attachments and archive on our storage, delete the attachments in ServiceNow
  3. for some records, compress (zip) their attachment(s), add the compressed file as an attachment and delete the original attachments

For option 3 - does anyone have insight on how to do this via script from within ServiceNow - specifically creating the compressed file that contains the attachments?

 

Overall I'd think the flow would be

  • Identity the records that can have their attachments compressed.
  • Check the attachments.  For non-compressed files - add them to a zip file
  • Attach the zip file to the record
  • delete any attachments that are not compressed

thanks,

 

Steve

 

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

Supposedly one can do it using Flows: Zip and unzip attachments in #servicenow. Courtesy of @Uncle Rob. But it "needs" Tokyo.

View solution in original post

8 REPLIES 8

stevemac
Tera Guru

Thanks for the quick replies and a great solution.  Was not across for updates to Flow for zip / unzip

@Uncle Rob great video.  I'll be watching a few more of yours!

stevemac
Tera Guru

as an update on investigation - it appears we have some issues with data imports for Vulnerability Response (Tenable and NVD data).  Tenable import job chunks and NVD Import rows are getting removed OK, but attachments related to them are not.  Should recover ~330GB.  Once confirmed / addressed will start a new item with the details incase others are impacted

LongC
Tera Contributor

Hello @Uncle Rob , I would like to ask about setting passwords for the zip file. Is that possible to do it? Thank you so much.

If there is such a feature, I'm not aware of it.
The only places I've explored are the Flow Designer zip steps for Flow Action builder, and I've read through the RPA documentation.   Can't find anything about password protection in either.  

 

What's the use case?