Service now attachments are not showing up in Manage Attachments section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 04:26 AM
I'm using service now api https://xyz.service-now.com/api/now/attachment/file api for attaching files to the incidents. Files are getting attached to the incident and they are appearing in activity section but not showing up in the Manage Attachments section. How do I resolve the issue? |
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2020 02:16 AM
The issue seems to be caused by records in the sys_attachment table that have the wrong table associated with them. In our case this is because we have created a child table of the incident table and the attachments point to the parent 'incident' table instead of the child table.
Here is a script that you can run as a background script to analyse the sys_attachment table (be careful when running this in a production environment as there may be a massive amount of records in that table!):
var tableName = 'incident';
var grAttachment = new GlideRecord('sys_attachment');
grAttachment.addQuery('table_name', tableName);
grAttachment.query();
while (grAttachment.next()) {
var recordSysID = grAttachment.getValue('table_sys_id');
var grIncident = new GlideRecord('incident');
if (grIncident.get(recordSysID)) {
var incidentClass = grIncident.getValue('sys_class_name');
if (incidentClass != tableName) {
gs.print(gs.getMessage('File "{0}" [{1}] attached to {2} "{3}"', [
grAttachment.getValue('file_name'),
grAttachment.getUniqueValue(),
incidentClass,
grIncident.getValue('number')
]));
}
}
else {
gs.print(gs.getMessage('File "{0}" [{1}] no longer attached to {2} with sys_id={3}', [
grAttachment.getValue('file_name'),
grAttachment.getUniqueValue(),
tableName,
recordSysID
]));
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2021 02:22 AM
Hi,
Did you got any solution? We are also facing same issue as attachment is visible in activity but not available in Managed Attachments, also in activities it is visible for admins only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 05:24 AM
Hi dhanu,
Have you seen the reply to my own message above?
If this works for you, please Mark as helpful, thanks.
Best regards,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 05:02 AM
Hello,
If anyone has solved this yet please post it here as I'm facing the same issue. I'm using an After Instert business rule on sys_attachment table.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 05:24 AM
Hi Magali,
Have you seen the reply to my own message above?
If this works for you, please Mark as helpful, thanks.
Best regards,
David