- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2014 05:24 PM
Hi Community - looking for some assistance please.
I want to be able to copy attachments from a change record to the approval record so that it is sent with the approval email. I have a copy attachment business rule from Call to Incident which works but cannot get this one working as expected.
What I currently have:
- Business Rule: Add Attachments to Change Approval
- Table: Change Request [change_request]
- When to run: After Insert or Update
- Condition: current.approval.changesTo('requested')
- Script: GlideSysAttachment.copy('change_request', current.sys_id, 'sysapproval_approver', current.sysapproval.sys_id);
- Notification email: Change Approval Request
- Table: Approval [sysapproval_approver]
- What it Will Contain: Include Attachments ticked
If I manually add an attachment to an approval record and then resend all is good. I just cannot get the attachment to the sysapproval record and I believe it will be a syntax issue
Any suggestions much appreciated
Cheers
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2014 05:47 PM
I think your script doesn't work because you can't dot walk from the change request to the approval, but you can dot walk from the approval to the change. I would change this to run in an insert business rule on the approval table when the approval is related to change request.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2014 05:47 PM
I think your script doesn't work because you can't dot walk from the change request to the approval, but you can dot walk from the approval to the change. I would change this to run in an insert business rule on the approval table when the approval is related to change request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2014 06:12 PM
Thanks Brad - absolutely brilliant - works a treat
For others changed as follows:
Business Rule: Add Attachments to Change Approval
- Table: Approval [sysapproval_approver]
- When to run: Async Insert
- Condition: LEAVE BLANK
- Script: GlideSysAttachment.copy('change_request', current.sysapproval.sys_id, 'sysapproval_approver', current.sys_id);