Hide the other user comments and show user own comments in kb article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2022 01:19 PM
Hi,
I need to have all users are allowed to add comments to Knowledge Articles, but Users can only see their own comments, Knowledge Managers can see all comments.
Please help how to achieve this.
Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2022 02:07 AM
Hi, you haven't clearly indicated where\how the KB articles are being viewed, based on 'topic' I assume via a portal widget? So one of these posts might be the answer your are looking for, but without specific details I am guessing.
https://community.servicenow.com/community?id=community_question&sys_id=b6781c3bdb4fa410190b1ea6689619f3
https://community.servicenow.com/community?id=community_question&sys_id=e2385a15db195c90d58ea345ca96195b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 07:33 AM
Hi,
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 is this the right way or something i am missing.
KB Article Hide comments instance.