Copy attachments from an RITM request to the sys_approval_approver table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 06:52 AM
good day,
i have a business case here.
When a user submit a catalog item, it will create an RITM request with an attachment but if the user forgets to attach and item, i would like to have the ability for the user to attach the document onto the open RITM request and then have that attachment to appear for the Approver in the email.
ex.
the item highlighted is a newly attached Doc
i want that doc to now appear for the approver here:
i tried business rules on the sc_req_item table and sys_attachment but nothing seem to work and i am stuck here
PLEASE HELP...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 07:02 AM
You can write a business rule on sysapproval_approver
attachApproval();
function attachApproval()
{
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.sysapproval);
gr.query();
while(gr.next()) {
GlideSysAttachment.copy("sc_req_item", gr.sys_id, "sysapproval_approver", current.sys_id);
}
}
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 07:09 AM
i tried it before as i found it on the treads and not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 07:24 AM
Hi @Peter Williams
You have removed the default syntax of Business rule.Please don'nt remove the code and add code where // Add your code here is mentioned
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 07:35 AM
same deal, not attaching