Other language translated Kb articles are showed on incident related search results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:32 PM
Hi
We have enabled translated articles when one article translated to another language it is created two article one is English and another one is Spanish
When am creating incident if i provide short description which will match of articles it is showing both articles
I need to show based on user language
if User spanish it has to show spanish translated articles
if user is English then it needs to show only English Language articles
How we can achieve this scenario
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:56 PM
Hi,
Try the below BR and let me know if it works?
(function executeRule(current, previous /*null when async*/) {
// Get the user's preferred language
var userLanguage = gs.getSession().getLanguage();
// Add a query condition to filter articles based on the user's language
if (userLanguage == 'es') {
current.addQuery('article.language', 'es');
} else {
current.addQuery('article.language', 'en');
}
})(current, previous);
Regards,
Shoheb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 12:06 AM
Hi,
I would try looking into the Search Context(Probaly something Incident) -> Resource Configuration -> Knowledge -> Condition.
Here you can add a query condition where you can try take a look at the langauge field and the getsession.getlanaguge.
The above idea is fine, too, but made as a query business rule it would make it for all queries to the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 01:51 AM
@NotNowBoss Could you please help me to sample condition query what i need to update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 02:26 AM
@Madankumar N1 This is just a guess from the head:
If this does not work, i think there is a way you can code it.
Search Context -> Table Configurations -> Filter Configurations.
In the filter configuration you will you will pcik the resources configuration knowledge articles and table configuration should be incident. Tan click true for Scripted filter.
Somewhere before the return statement input this:
Ill try to try it out on a PDI later.