File attachment download folder in ZIP format with the number of the incident, service, change, etc.

Alessa
Mega Guru

Hello dear community I need help:

1 I have a UI Action that allows me to download attachments as a ZIP file:

find_real_file.png

Script:

action.setRedirectURL('download_all_attachments.do?sysparm_sys_id=' + current.getUniqueValue());

2 It works properly:

find_real_file.png

3 When I check my downloads I get the ZIP file like this:

find_real_file.png

 

I would like to know if it is possible to download the ZIP file with the number of the incident. 

 

For example something like this:

find_real_file.png

 

If the ZIP file contains the number of the incident, service, problem, etc. from which the files were downloaded, we will be able to know where those attachments come from.

I hope you can help me.

Thanks in advance.

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

As mentioned in your other thread, this is OOTB java processor, which you can not pass number or make any  changes.

 

Create custom processor and there you can add new parameter to rename your file name with record number, you can refer below blog, which has mentioned sample code. That will solve your requirement. 

 

https://servicenowguru.com/scripting/download-attachments-zip-file/

View solution in original post

3 REPLIES 3

Slava Savitsky
Giga Sage

This export is handled by a Java processor, which is a black box. You cannot see or change its logic.

Harsh Vardhan
Giga Patron

As mentioned in your other thread, this is OOTB java processor, which you can not pass number or make any  changes.

 

Create custom processor and there you can add new parameter to rename your file name with record number, you can refer below blog, which has mentioned sample code. That will solve your requirement. 

 

https://servicenowguru.com/scripting/download-attachments-zip-file/

You are the best!!