How can I disable guests from leaving comments on KB articles

Jackie23
Kilo Guru

I am working on getting our knowledge base up and running for the KB Manager. We want users to be able to comment on KB articles, but we want to make sure they are logged in. 

When someone is not logged in they can leave a comment as "guest" and we would have no way of knowing who left the comment. We would still like all KB articles to be visible to the public, but just make them sign in if they want to leave a comment. 

How can I make this happen?

 

Thanks,

Jackie 

1 ACCEPTED SOLUTION

Jackie23
Kilo Guru

I have found the solution. 

 

Change the Application from Default- Global to Knowledge Management - Service Portal. Locate the "Knowledge Article Comments" widget and uncheck public. This gets rid of the entire comment section if you are not logged in. Once you log in you will be able to leave a comment. 

 

find_real_file.png

View solution in original post

5 REPLIES 5

Deepak Ingale1
Mega Sage

Hi,

You can write before insert business rule on kb_feedback table with condition as 

 

condtion field  : gs.getUser().getDisplayName() == "guest" && current.comments.changes()

 

Script field :  current.comments = '';

This script will overwrite the comments entered by guest users

 

Note: Please mark reply as correct if it has answered your original question or mark it as helpful if it has provided some help 

 

 

 

 

Didn't seem to work. I attached the business rule I did and how it is still letting "guest" post a comment. 

 

Do you see an error in my business rule?

 

find_real_file.png

find_real_file.png

 

 

Yes, this is not working, what is happening is that comments in kb_feedback table are showing empty, however comments on kb_view are available. This should not be the case ideally. 

 

I also thought to restrict access on comments field on kb_feedback by createing WRITE ACL, I could disable comment access to kb_feedback comments field, however comments on kb_view page still appears.

 

Please see below articles if those can be helpful to you

https://community.servicenow.com/community?id=community_question&sys_id=4f814369db98dbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=e41983e1db5cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=00f94b29db5cdbc01dcaf3231f96...

 

 

Jackie23
Kilo Guru

I have found the solution. 

 

Change the Application from Default- Global to Knowledge Management - Service Portal. Locate the "Knowledge Article Comments" widget and uncheck public. This gets rid of the entire comment section if you are not logged in. Once you log in you will be able to leave a comment. 

 

find_real_file.png