How to copy the RITM's attachment to SC task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 04:51 AM - edited 07-27-2023 04:54 AM
Kindly check the below mentioned requirement and please suggest how to achive this.
Attachment should only be copied to those task where assignemnt group of task is "Ultima". means there could be some task where assignemnt group is alrready "ulmita" and some task might be assignment to ultima by helpdesk gruoup
1) While raising the request from portal user can add the attachment and that attachment would be visible on ritm form so we want that attachment to be copied to sc task also but when task gets created approval approval if any.
2) User can go to portal and add the attachment to already raised request so that attahment should also be copied to sc task.
3) Duplicate attachment should not be copied to task otherwise it will run in loop.
If this can be done though script then please share the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 05:03 AM
Hello @VIKAS MISHRA
Kindly check the link below :-
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 06:49 AM
Hi,
Please create a insert BR on sys_attachment table
in the table use the code. PFA screenshots
(function executeRule(current, previous /*null when async*/ ) {
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.table_sys_id);
if (ritm.assignment_group == 'Ultima') {
var scTask = new GlideRecord('sc_task');
scTask.addQuery('parent', current.table_sys_id);
scTask.query();
while (scTask.next()) {
GlideSysAttachment.copy('sc_req_item', ritm.sys_id, 'sc_task', scTask.sys_id);
}
}
})(current, previous);
Please let me know if any issue.
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 01:06 AM
@VIKAS MISHRA If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain