Fetch KB Articles which does not have translated articles in the related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 03:12 AM
We are trying to pull the report from kb_knowledge table for a specific Knowledge Base which does not have translated articles related to it. We checked in the relationships table & found the below code. However, we are unable to modify to only fetch the parent KB articles. Please let us know how to proceed on this.
The OOTB SI script is as below:
var KBTranslationSNC = Class.create();
KBTranslationSNC.prototype = {
initialize: function() {
},
/**
* returns encoded query for getting translated version of given article .
*
* @param GlideRecord: kb_knowledge record.
*/
getTranslatedVersionEncodedQuery: function(articleGr){
var kbArticleGr = new GlideRecord('kb_knowledge');
if (new KBCommon().isVersioningInstalled() && !articleGr.summary.nil()){
//Versioning is installed and this article is versioned.
if (gs.nil(articleGr.parent)){
kbArticleGr.addQuery('parent',articleGr.sys_id)
.addOrCondition('parent.summary', articleGr.summary);
}
else {
kbArticleGr.addQuery('summary', '!=', articleGr.summary);
//Bypass Before query BRs for dotwalking.
var temp = new GlideRecord('kb_knowledge');
temp.setWorkflow(false);
temp.get(articleGr.parent);
kbArticleGr.addQuery('parent',articleGr.parent).addOrCondition('parent.summary',articleGr.summary).addOrCondition('summary', temp.summary);
}
}
else {
if (gs.nil(articleGr.parent))
kbArticleGr.addQuery('parent', articleGr.sys_id);
else {
kbArticleGr.addQuery('sys_id', '!=', articleGr.sys_id);
kbArticleGr.addQuery('parent', articleGr.parent).addOrCondition('sys_id', articleGr.parent);
}
}
return kbArticleGr.getEncodedQuery()+'';
},
/**
* returns true if the artcile has any translated version.
*
* @param GlideRecord: kb_knowledge record.
*/
hasTranslatedVersion: function(articleGr){
var kbArticleGr = new GlideRecord('kb_knowledge');
var encodedQuery = this.getTranslatedVersionEncodedQuery(articleGr);
kbArticleGr.addEncodedQuery(encodedQuery);
kbArticleGr.query();
if(kbArticleGr.hasNext())
return true;
return false;
},
type: 'KBTranslationSNC'
};
- Labels:
-
Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 09:21 AM
Hi all. As a Knowledge Admin in ServiceNow, I have a similar need, but don't have access to change any scripts.
I have 100 English articles (aka: "the parent article") and each English article has 2 article translations (French and Spanish). I want to check my work to ensure all 100 English articles have 2 associated translations, but I am unable to determine how to configure a report in the either the Knowledge list view or in the Reporting module to identify missing translations.
Without access to scripting, does anyone have any guidance they can provide?
Thanks
Mark Greenwood
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:59 PM
There is a reporting table "Related Articles - kb_2_kb" which would be helpful if your practice is to relate the parent article to the child articles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 02:51 AM
I have similar requirement Do you have any idea on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 05:08 AM
Hi,
We had the same need and we made many attemps to find a solution.
We didn't find any OOB solution.
At one point I used extract data and vlookup in Excel to get what I wanted but it was a lot of work everytime I needed to pull out that report.
We ended up creating an additional field in the KB form "translated version" that pulls the value that is available in the lower tab of the KB "translated versions"
It fetches the most recent published version and fills the field on top.
We also made it available in our lists.
That way, we can search and filter for "empty" value, wich indicates KB with no translation.
Hope this can help
Rene