
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 02:45 AM
Hi all,
Is it possible to take attachments added to a Change_task and put them on the Change record itself? One of our workflow steps is to create a task for creating an estimate, as part of this it requires an attachment and then can be closed. I want that attached estimate to be added to the Change record itself once the task has been closed so that the customer can see it.
Kind Regards,
John
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 06:35 AM
As your requirement is to copy attachment when the task is closed
Create a business rule on change_task with condition as state changes to closed
and use the following script
GlideSysAttachment.copy('change_task', current.sys_id, 'change_request', current.change_request);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 06:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 06:35 AM
As your requirement is to copy attachment when the task is closed
Create a business rule on change_task with condition as state changes to closed
and use the following script
GlideSysAttachment.copy('change_task', current.sys_id, 'change_request', current.change_request);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 06:48 AM
Perfect this works for me and as it would never be removed im not too worried about that for now.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 09:20 AM
hi DVP,
greetings !!!
thank you for your detailed explaination. I have small query:
-> How we remove the attachment from the task, after task is closed/completed.
(Reason why i am asking because, there in un-necessary data in the instance, you may say this data as duplicate data)
With Regards,
amIT kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2019 09:33 AM
You can use deleteAttachment method in GlideSysAttachment
Below link might be helpful
https://docs.servicenow.com/bundle/jakarta-application-development/page/app-store/dev_portal/API_reference/GlideSysAttachmentScoped/concept/c_GlideSysAttachmentScopedAPI.html