- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 07:36 AM
I have a requirement to attach a document to notification email but include attachment feature not working.
Basically, I need the attachment to show in the approval notification email the approver gets. In my workflow for requested items, I have a task where an itil user has to attach a document for review by the approver. when the task is closed, an approval request is generated. so when the approver gets the email, I want the attachment to show in the email. Most of the approvers are not itil users so they need to be able to see this in an email. tried the include attachment feature in notification but it doesn't work. pls see below. not great with scripting so need some assistance pls.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 09:46 PM
Hi,
If the attachment is uploaded on requested item, you don't need getTaskId(). I assume your notification is created on the Approvals table (sys_approval_approver). Change the following line in the above code and I think you should be all set.
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id', current.sysapproval.sys_id); // current.sysapproval field should have the requested item object.
gr.query();
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 02:01 PM
Hi AliKutty,
Please can you explain this function. do I include it in the mail script?
function getTaskId(){
//Get the sys_id of your task by dot walking from approval record (current.sysapproval) to get the requested item and then the related task
// Or
// Pass it as a parameter if the email is triggered via event
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 02:05 PM
the attachment is added to the requested item, not the the task. the assignee attaches the task to the requested item then closes the task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2017 09:46 PM
Hi,
If the attachment is uploaded on requested item, you don't need getTaskId(). I assume your notification is created on the Approvals table (sys_approval_approver). Change the following line in the above code and I think you should be all set.
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id', current.sysapproval.sys_id); // current.sysapproval field should have the requested item object.
gr.query();
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 02:45 AM
Thank you very much. it worked !!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 03:06 AM
Hi,
Please mark the answer as correct so others can refer and we can close this thread.
How To Mark Answers Correct From Community Inbox
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response