You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



Prerequisites 


Procedures

To start sharing knowledge articles through script action, follow these procedures: 


Navigate to Dynamic Share

In ServiceNow's left side navigation window, navigate to Perspectium > Replicator > Dynamic Share or simply type and then click on Dynamic Share

Click New. 

Choose Dynamic Share Type

Select Business Rule and click the Submit button.

Create a Dynamic Share 

Select Knowledge in the Table dropdown, and check the Active box. 

Under the Trigger Conditions tab, check the Update box. Then, follow the rest of the steps in Create a ServiceNow dynamic share

Navigate to Script Actions 

In ServiceNow's left side navigation window, navigate to System Policy > Events > Script Actions. Then, click New

Create Script Action

In the Name field, type in Perspectium Share Knowledge. Select kb.view as the Event name, and check the Active box. 

Then, fill in the Script field with the following: 

pspShareKnowledge();

function pspShareKnowledge() {
	var pspR = new PerspectiumReplicator();
	var tableName = "kb_knowledge";
	
	var kbgr = new GlideRecord(tableName); 
	kbgr.get('sys_id', event.instance);
	kbgr.query();
	if (!kbgr.next())
		return; 
	
	var qc = new GlideRecord('psp_replicate_conf');
	qc.addQuery("table_name", tableName);
	qc.addQuery("sync_direction", "share");
	qc.addQuery("action_update", "true");
	qc.addQuery("active", "true");
	qc.query();
	while(qc.next()) {
		pspR.shareRecord(kbgr, tableName, 'update', qc.sys_id);	
	}
}

Click Submit

No valid Data Center license found

Please go to Atlassian Marketplace to purchase or evaluate Refined Toolkit for Confluence Data Center.
Please read this document to get more information about the newly released Data Center version.