- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2022 03:35 AM
Hi Community,
How we can attach the articles automatically on RITM or SCTASK form related link based on catalog item. How can we achieve this can you please any one help me on this.
Thanks in Advance,
Harsha Reddy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 02:08 AM
I found it
BR: After Insert on sc_req_item
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("m2m_kb_task");
gr.addQuery("sc_cat_item", current.cat_item);
gr.query();
while(gr.next()) {
var rec = new GlideRecord("m2m_kb_task");
rec.initialize();
rec.setValue("task", current.sys_id);
rec.setValue("kb_knowledge", gr.kb_knowledge);
rec.insert();
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2022 09:21 PM
Hi,
so knowledge articles are attached to catalog items.
those you want to see under RITM
you can use this script in after insert BR on RITM table
1) query sc_2_kb with catalog item and iterate and insert record into the related list table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 12:55 AM
Hi Ankur,
Can you please explain how to write BR?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 02:03 AM
Hi,
I am not able to find the related list of Attached knowledge on RITM form
Is that a custom one?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 02:08 AM
I found it
BR: After Insert on sc_req_item
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("m2m_kb_task");
gr.addQuery("sc_cat_item", current.cat_item);
gr.query();
while(gr.next()) {
var rec = new GlideRecord("m2m_kb_task");
rec.initialize();
rec.setValue("task", current.sys_id);
rec.setValue("kb_knowledge", gr.kb_knowledge);
rec.insert();
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2022 02:38 AM
If my response helped please mark it helpful as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader