How do we add a specific attachment to a notification via event queue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 03:07 AM
I have a requirement to generate an Email Notification via an event queue. in my case the incident contains two attachments but I need to pass only one attachment to the gs.eventqueue method. Can someone tell me if there is a way to achieve this? the following code is inserting all the attachments in the incident but I want only one attachment. any help would be appreciated!
gs.eventqueue('event record', incObj, RECIPIENTS.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 04:08 AM
Hi,
No direct way.
If you use the Include attachment checkbox it would pick all the files and include in outbound email
Solution/Workaround:
1) create an after update BR on sys_email with proper condition such as it should run only for your notification subject and table
2) in the script you can query sys_attachment and create a record into sys_email_attachment for that specific attachment
I had used something similar in the past and it had worked
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 10:54 PM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2022 03:37 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2022 07:20 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader