Show only user own comments for knowledge article in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 09:56 AM
Hi,
II have a requirement to show only user own comment for a knowledge article on service portal. I tried to clone the widget "kb article comments" and created cloned "kb article hide comments" widget. Updated the getfeedback function as below to show only logged in user comments.
// private functions
function getFeedback(articleID) {
var feedback = [];
var gr = new GlideRecord("kb_feedback");
gr.addQuery("article", articleID);
gr.addQuery("flagged", false);
gr.addQuery("user", gs.getUserID()); // added this line
gr.addNotNullQuery("comments");
gr.orderByDesc('sys_created_on');
gr.query();
while (gr.next()) {
var f = {};
add('comments');
add('rating');
add('user');
add('useful');
add('sys_created_on');
feedback.push(f);
}
return feedback;
But still all users comments are showing on service portal kb article. Please see below how i set up cloned widget in kb_article page. Please help
KB Article Hide comments instance.
- Labels:
-
Knowledge Management
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:33 AM
It looks like you modified kb_article page, but most new tenants are likely using the kb_article_view page when viewing articles. Even if the URL doesn't show this page, there may be a Page Route Map setup to redirect users from kb_article to kb_article_view on some or all service portals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2022 08:25 AM
Hi Erik,
That is correct. So how we could achieve this. We have Knowledge Article Comments widget which is in kb_article_view page.
Any help will be appreciated?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2022 08:39 AM
I'm not sure what you're asking me. You created a cloned/custom widget "KB Article Hide Comments" and added it onto the kb_article page... that's what you have showing in your screenshots...
What I said is you may be using the kb_article_view page instead, so you need to add your customized widget onto that page. Have you done that, and removed the baseline widget from that page, as you did on the other page? Are you saying this is still not working? Please be more clear with what you have done and what you are asking for assistance with in the future.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2022 09:08 AM
Hey,
Found one relevant article on the community:
Show only user's comments on KB Articles
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar