KB Article Versions and how to force open latest published version

antryan
Giga Contributor

In our Service Offerings we have fields that contain links to KB articles.

find_real_file.png

Since upgrading to Kingston from Istanbul and turning on versioning in knowledge, we now have an issue where if a new version of an article is created, the fields will still show previous the version/s. 

Sure, when someone opens the article it prompts sayings a new version is available, however this is not an ideal UX.

Any ideas on how to either force when opened to go to the latest version, or somehow programmaticly dynamically update the field to only show the latest version?

11 REPLIES 11

I do totally agree with this. We have the same issues - we need to publish links to KB articles in our intranet. After updateing the KB article that link is no longer valid. Which is an issue since you have to ensure the manual update at every occurence. IMHO the idea of a fixed URL for KB article is the right one and I fully support. -> Use of the permalink option solves this issue. It creates a URL based on the KB article ID instead of the internal article ID of Servicenow.

Sandhya Bellann
ServiceNow Employee
ServiceNow Employee

Logic to fetch the Sys_id of the latest version of the KB Article if the current ones is not published.

Change the logic as per your requirement

var kb = new GlideRecord('kb_knowledge');
kb.addQuery('sys_id','542d9ff2db8c6f0004edb1c0ef961997');
kb.query();
if(kb.next()) {
	if(kb.workflow_state == 'published') {
		gs.print('Published KB sysid: '+ kb.sys_id);
	}
	else if(kb.workflow_state == 'outdated') {
		num = kb.number;
		gs.print('num' +num);
		var kbn = new GlideRecord("kb_knowledge");
		kbn.addQuery('number',num);
		kbn.query();
		while(kbn.next()) {
			if(kbn.workflow_state == 'published')
				gs.print('Published KB sysid: '+ kbn.sys_id);
		}
	}
}

Where should I add this code in order if old article is opened ?

Hi,

Create content item and give content type as external content then it will ask you to enter URL provide the knowledge article URL. It will directly points to the latest version.

I want to do this in the related articles. If a old version related article is added and some one opens it then it should automatically take the user to the latest one. Possible?