Adding attachments to templates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 03:49 AM
Hi
Does anyone know of a way to add an attachment to a template so when the template is used the attachment is also added to the change, incident etc?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 06:31 AM
SO there would be some code to copy values from Template to Change record.
Add an attachment in the Template
Now add: GlideSysAttachment.copy('sys_template', 'template's sys_id', 'change_request, 'current.sys_id');
Basically, GlideSysAttachment.copy is a function that copies attachment from 1 record to another.
Mark helpful if it helped or correct if answer is correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 06:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 08:03 AM
Hi Anurag
Sorry I think even I was being a bit dim here.
I have modified the line to look like
GlideSysAttachment.copy('sys_template', 'sys_template.sys_id', 'change_request', 'current.sys_id');
I have added to the apply template script shown above but it does not seem to be copying the attachment to the change request when I apply the template.
It does save OK now.
Thanks Steve

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 08:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 08:32 AM
Thanks Kalai
I will check these out ASAP.