How to Attach and Attachment onto an Approver email after the RITM number is created

Peter Williams
Kilo Sage

Good morning,

 

i need to find a way when users attach a new attachment on the RITM request and have that attachment then get attached to the Approver to see on their email.

 

Basically, i want to be able to attach any attachment here on the request that was submitted

PeterWilliams_0-1727268861848.png

 

then forward that attachment for the approver to see on their emails

 

PeterWilliams_1-1727268916488.png

 

I created a button to Resend the Approver email however i need to be able to get the attachment onto the approval when they attach it onto the RITM submitted request

 

 

Please help....

 

 

7 REPLIES 7

@Peter Williams ok then use copy attachment action twice, one to copy from RITM to approval and another to copy from RITM/approval to email record.

 

AnanthaGowrara_0-1727284694468.pngAnanthaGowrara_1-1727284714780.png

 

Victor29
Tera Contributor

Approach  — Flow Designer "Send Email" action with attachment

If you're controlling the approval notification from **inside your Flow Designer flow** rather than relying on the built-in notification engine, use a **Send Email** action step.

### In Flow Designer

After your `Ask for Approval` or `Create Task` step, add a **Send Email** action:
```
Action: Send Email
To: [Approver's email pill]
Subject: Approval Required - AdHoc Invoice ${trigger.number}
Body: [your template]
Attachments: [Trigger > RITM > Attachments] ← this is the key pill

Victor29
Tera Contributor

Another Approach  — Script Include + Event-driven notification

For the most control — especially useful in your AdHoc Invoice flow where multiple groups need to see the invoice PDF — use a Business Rule or Flow Script to fire a custom event, then attach via the notification's event handler:

Step 1 — Fire a custom event from your flow (Run Script action):

// In Flow Designer Run Script step
var ritmSysId = fd_data.trigger.current.sys_id.toString();
var approvalId = fd_data.create_approval.sys_id.toString();

gs.eventQueue(
'adhoc.invoice.approval.requested', // custom event name
GlideRecord('sysapproval_approver', approvalId),
ritmSysId, // parm1 = RITM sys_id
approvalId // parm2 = approval sys_id
);
```

**Step 2 — Register the event** under `System Policy > Events > Registry`:
```
Event name: adhoc.invoice.approval.requested
Table: sysapproval_approver

**Step 3 — Create the notification triggered by this event:**

Notification name: AdHoc Invoice - Approval Request
Table: sysapproval_approver
When to send: Event fired = adhoc.invoice.approval.requested

Subject: Action Required: AdHoc Invoice Approval - ${event.parm1}

Body:
Dear ${approver.name},

An AdHoc Invoice requires your approval.
RITM: ${document.number}
Amount: ${document.variables.invoice_amount}
Customer: ${document.variables.customer_name}

Please review the attached invoice and approve or reject
via the link below:
${approval_url}

 

Attachment script:

// Notification attachment script
// Runs in context of the sysapproval_approver record (current)

var attachments = [];

// Get the RITM sys_id from the approval's document_id
var ritmSysId = current.document_id; // document_id = the RITM sys_id

var attGR = new GlideRecord('sys_attachment');
attGR.addQuery('table_name', 'sc_req_item');
attGR.addQuery('table_sys_id', ritmSysId);
attGR.query();

while (attGR.next()) {
attachments.push(attGR.sys_id.toString());
}

return attachments; // array of sys_attachment sys_ids to attach to the email