Attachment for approval email notification from catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Requirement:
There requset called Wan connection once requested request item generated in that catalog task generated for this catalog task 1 user attache draft form 20 closes the task once task 1 closed then catalog task 2 generates there user will attach the final form 20 and also attach approval email then closes the task now in request item approval will go now i want here one approval email notification should send to apporvers and also need attached the final form 20 which is attached in catalog task 2 which extension.pdf then in email notification i want to show approve and reject buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Can you ask your question again with punctuation, so we can read what it is exactly you are asking?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
10+ Tips for writing a quality community question
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Ankur Bawiskar I like this response 😄
Regards,
Harish K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @jreddy7
1. Use the built-in Copy Attachment action to copy attachments from the Catalog Task to the RITM upon the task closure
- If it is WF/BR, Check for script
GlideSysAttachment.copy('sc_task', current.getUniqueValue(), 'sc_req_item', current.request_item.getUniqueValue());
https://www.servicenow.com/community/developer-forum/attachment-in-approval-notification/m-p/1465852
- Create an Email Notification Script for the .pdf
You can retrieve and attach the Form 20.pdf using an Email Script
- Navigate to System Policy > Email > Notification Email Scripts and click New.
- Name it: include_final_form
(function runMailScript(current, template, email, event, email_action) {
var grAttach = new GlideRecord('sys_attachment');
grAttach.addQuery('table_sys_id', current.sysapproval.sys_id);
grAttach.addQuery('table_name', 'sc_req_item');
grAttach.addQuery('file_name', 'CONTAINS', '.pdf');
grAttach.orderByDesc('sys_created_on');
grAttach.query();
if (grAttach.next()) {
template.print('Attachment: <a href="sys_attachment.do?sys_id=' + grAttach.sys_id + '">' + grAttach.file_name + '</a>\n');
email.addAttachment(grAttach.getValue('sys_id'));
}
})(current, template, email, event, email_action);
3: Create the Approval Notification
- Navigate to System Notification > Email > Notifications and click New.
- Set Table to Approval [sys_approval_approver].
- Under the When to receive tab, set the condition to trigger when State changes to Requested.
- Under the What it will contain tab, invoke your script in the message body using ${mail_script:include_final_form}.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti