Prevent feedback tasks from also being added as a comment on articles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I want to change the OOTB function that allows a feedback comment to also add as a comment on the article as it will create too many emails and noise.
I have an email notification that triggers when a feedback task has been assigned to me but with the OOTB settings on for article ratings, emails are also being triggered which I want to stop.
These are the settings I have configured:
This is what happens when a user leaves feedback:
To be clear - I do want emails to be triggered when comments are left on an article, but I don't want comments via these feedback tasks to be added as a comment.
What can I change so that the comments from a feedback task don't get added as a comment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Try this and let me know what your result is :
Navigate to System Definition → Business Rules.
Create a Before Insert Business Rule on kb_feedback_task.
Add the following script:
(function executeRule(current, previous /*null when async*/) {
// Get the parent feedback record
var fb = current.feedback.getRefRecord();
if (!fb) {
return;
}
// If the feedback is from "helpful = No" or has a rating
if ((fb.helpful == false) || (fb.rating && fb.rating > 0)) {
// Prevent the comment from being saved against the article
current.comments = ''; // removes the text so it won't display
}
// If it's a direct comment (no rating, helpful not set/true), keep as-is
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks for helping me however this business rule doesn't work as the kb_feedback_task doesn't have a parent - the comment is still posted underneath the article. Here's what I've observed with these comments and the related tables:
kb_feedback | Direct article comment | Feedback comment |
Useful value- | - | No |
Rating value | (empty) | 1, 2, 3 (4 and 5 don't trigger feedback tasks or ask for comments) |
Reason value | - | (contains anything) |
Live message value | (contains something, matches Comments value) | (empty) |
Comments value | (is anything, tends to be wrapped in <p>) | (is anything) |
kb_feedback_task | ||
Feedback Task Type value | - | User feedback |
Reason value | - | (is anything) |
Description value | - | (contains something, matches Comments value) |
It seems that the kb_feedback_task doesn't get created unless the comment is posted.
I had a business rule on the kb_feedback table that deleted the comment after insert but the associated feedback task was never created. I have also tried a UI Policy to hide the comment which hasn't worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Ignore the earlier code.
I think if you comment out the modal code you wont have the comments ever posted in the article itself
Here is your modal
kb-feedback-task-modal
Link:
YOURINSTANCEURL/sp_ng_template.do?sys_id=e215143f53330300cc376512a2dc3414&sysparm_record_target=sp_ng_template&sysparm_record_row=2&sysparm_record_rows=3&sysparm_record_list=sp_widget%3Da47ea1cb0b9432004ce28ffe15673a5b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I don't think that is the place I need to edit - that looks like the code that sets the look/contents of the feedback pop up. I'll try look at the widget that you suggested in your other comment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
ok, just to be clear there is nothing OOB , about the stuff you are looking for. You might have to do customization