How to attach article on RITM or SCTASK based on catalog item

Harsha Reddy
Tera Contributor

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 

1 ACCEPTED SOLUTION

@Harsha Reddy 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you explain in detail with example what is your requirement?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

We are following SOP for the catalog item example for account creation we have a SOP to fulfil the request, if we attach knowledge article its really helpful the task fulfillment group.

 

Regards,

Harsha Reddy

Hi,

Sorry can you explain with example and screenshot.

which article should get attached to RITM and SC TASK?

how are you determining the articles getting attached?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader