Popup is coming from the ng-template "kb-feedback-task-modal" attached to the widget – "kb-article-content".
To make details mandatory – you need to modify the method – c.submitFeedbackTask in the widget – "kb-article-content".
line 461 in client controller.
c.submitFeedbackTask = function(){
// c.data.details if details is empty and c.data.reason=="4" user selected reason as other
if(c.data.reason=="4" && c.data.details==""){
c.flagMessage = "${Please provide the mandatory details}";
$("#detailsComment").focus();
return false;
}
else{
c.submitted = true;
c.closePopup();
}
}
How to make "details" as mandatory when Helpful is selected as "NO" and user select other option in knowledge article ServiceNow
Working Code Asked question July 20, 2023