Show the list of attachments linked to issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 08:18 AM
Hi All,
Im trying to create a list to see all the attachments that were created for the Issue table.
I could just go to the sys_attachment table and filter out records for sn_grc_issue table but I also need to see what is the issue that this particular attachment is linked to.
I created a DB view but the issue info is blank:
as you can see I have the attachment name, its sys ID ant type but I cant see what issue it is related to
here is the DB view I created:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 12:07 PM
Hello,
I think it is the problem of your data etc
I can see these columns with same database view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 01:00 PM - edited 06-05-2025 01:07 PM
I agree with Muhammad, I don't have the sn_grc_issue table, but the same DB view for incident attachments works.
You can see the same using the following script in 'Scripts - Background':
var inc = new GlideRecord('incident');
inc.query();
while (inc.next()) {
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', inc.sys_id);
att.query()
if (att.next()) {
gs.info('inc: ' + inc.number + ' has attachment with file name: ' + att.file_name);
}
}
replace 'incident' in line 1 with 'sn_grc_issue'.