
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 07:31 PM
Hi all,
I would like to get attachment file name in my inbound action which makes incident.
Is it possible?
* I think this is impossible... because inbound action is unable to get email attachment file name,
and even if sys_attachment can be queried, there isn't no attachment because at that time inbound action haven't made incident yet.
ANY help is welcome.
Best regards,
Tomoaki
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 08:26 PM
Hi,
Try this!
{slight change in uday's script}
var attachmentName = '';
var test = sys_email.sys_id;
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name','sys_email');
gr.addQuery('table_sys_id',test);
gr.query();
if(gr.next()){
attachmentName = gr.file_name;
}
Thanks
Kush
Please mark the answer correct/helpful accordingly!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 08:06 PM
Hi,
Haven't tested this but try below script to fetch attachment name.
var emailSysId = '';//sys id of the email received
var attachmentName = '';
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name','sys_email');
gr.addQuery('table_sys_id',emailSysId);
gr.query();
if(gr.next()){
attachmentName = gr.file_name;
}
Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.
Regards,
Udhay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 08:17 PM
To fetch sys id of the email inside the inbound script you can use "email.recipients_array", one of the values stored in this array is the 'sys_id' of the email record in the 'sys_email' table.
For more information you may also refer the docs URL or community post,
Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.
Regards,
Udhay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 08:26 PM
Hi,
Try this!
{slight change in uday's script}
var attachmentName = '';
var test = sys_email.sys_id;
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name','sys_email');
gr.addQuery('table_sys_id',test);
gr.query();
if(gr.next()){
attachmentName = gr.file_name;
}
Thanks
Kush
Please mark the answer correct/helpful accordingly!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2018 08:30 PM
I think it's tricky to achieve that, or may be not possible, what is the business use case here?