- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 07:54 AM
Hi there,
I have a issue which I want to fix. It goes about the following thing:
1.) When I use the OOTB "Add attachments" Service Portal form functionality, I can add more than one attachment, and all of these attachments are shown at the Incident in the backend within a ribbon on the top of the Incident, and below in the timeline of the Incident.
Please see screenshots 1, 2 and 3.
2.) When I create a separate attachment field (form variable, type = "Attachment"), I can only upload one attachment per attachment field. Also this attachment is not shown at the Incident in the backend within the ribbon on the top of the Incident. Only below in the timeline the attachment is shown.
Please see screenshots 4 and 5.
My questions:
1.) How can I configure ServiceNow / the Catalog Item, to show all attachments at both places?
2.) How can I upload more than one attachment by using a separate attachment field?
Thanks!
Screenshot 1:
Screenshot 2:
Screenshot 3:
Screenshot 4:
Screenshot 5:
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2024 07:36 AM
I tried that script, didn't work for me either.
Here's a modified one , this should work.
BR name : Remove ZZ_YY😊
Table : incident
When : After
Insert : true
Script:
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "ZZ_YYsc_cart_item");
gr.addQuery("table_sys_id", current.sys_id);
gr.query();
if (gr.next()) {
gr.table_name = current.getTableName().toString();
gr.update();
}
Just to explain this a bit : When you attach a file to your attachment type field, a record is created in the sys_attachment table with Table Name set to ZZ_YYsc_cart_item. Our business rule is gonna run when the incident is created, and it would query this particular sys_attachment table record, and finally update the Table Name to incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2024 07:28 AM - edited ‎08-22-2024 07:42 AM
Thanks @AnirudhKumar!
This works very well. One last question: this solution works for every Catalog Item / Record Producer, which has it's output to a Task (like Incident)?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2024 08:27 AM
The script is dynamic enough to fix all Task records, but not the trigger.
Our BR runs only on incident record insert... So this solution applies only to incidents. We could set the table on the BR to Global, that should apply the fix everywhere. But a part of me says that's stretching too much.