Is there a way to link to the latest Major Version of a knowledge article?

michaelzawacki
Mega Contributor

We are on Jakarta, and using versioning for knowledge articles.   My concern is if we send a link to an article, and then it is superseded by a newer major version, the link is still to the older version.   Is there a way to use a link that will automatically pick the latest major version?

Thanks!

michael

1 ACCEPTED SOLUTION

Lucas Vieites
Tera Guru

Hi Michael,


if you use the link to the KB number; eg "/kb_view.do?sysparm_article=KB01234567" your users will always be directed to the latest published version of the article. If you use the sys_id to create the link and it goes to an older version, the users will see the "Article State: Outdated" message indicating they are not reading the latest information.


View solution in original post

12 REPLIES 12

The link I provided above does not work in a lot of cases, because that leverages the ITSM-focused knowledge article viewer.  If HR wants to have their own page with their own layout and widgets (which they should if they're doing it right), you will need to create a new page designed for HR.

To make this work, you can clone/modify the service portal widget "KB Article Page", and add server script to read the KB # from the url.

 

Example (Server Script):

 

...

var articleGR = getArticleFromParameters();

...

function getArticleFromParameters(){
	var articleGR = GlideRecord("kb_knowledge");
	var sysId = $sp.getParameter('sys_id');
	if( sysId ){
		articleGR.get(sysId);
	}
	else {
		//try to get latest sys_id from KB #
		var number = $sp.getParameter('sysparm_article');
		if( number ){
			articleGR.addQuery("workflow_state", "published");
			articleGR.addQuery("number", number);
			articleGR.query();
			articleGR.next();
		}
	}
	return articleGR;
}

JulietChicago
Tera Guru

HI,

 

Did you find a solution to this issue of the permalink displaying the "latest version" and not the published version?

Hi Julie,

 

It's working for me.  If I do:

https://[instance].service-now.com/kb_view.do?sysparm_article=[kba_number]

 

It links to the last Major version.