Attachment ilmit for Incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 08:27 AM
Hi All,
We are limiting the attachment size with the below script in ServiceNow incident table.
(function executeRule(current, previous /*null when async*/) {
var grInc = new GlideRecord('sys_attachment');
grInc.addQuery('table_name',"incident");
grInc.addQuery('table_sys_id',current.table_sys_id);
grInc.query();
var totalSize=0;
while(grInc.next()) {
totalSize+= parseInt(grInc.getValue('size_bytes'));
}
if(totalSize+parseInt(current.getValue('size_bytes')) > 25000000) {
gs.addErrorMessage("Size of attachment(s) should be less than 25MB.");
current.setAbortAction(true);
}
})(current, previous);
But with this, unable to download the incident records from reports if the mentioned limit exceeds. Can we exclude this script for reports?
Please assist.
Thanks & Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 11:09 AM
Hi @Joshuu
I'm not understand very well this part
"But with this, unable to download the incident records from reports if the mentioned limit exceeds. Can we exclude this script for reports?"
Do you can expland me more?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:19 AM - edited 02-07-2025 02:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 08:21 AM
Hi @Joshuu
Would you have any more evidence?
This scenario is still a bit strange and doesn't make much sense. Why do you think it's because of this script that you can't download the reports?