How do I make changes in the content of Knowledge article feedback pop up?

vimal11592
Tera Expert

Hi,

 

I want to update the content of knowledge feedback modal pop up. But not able to find it. Is this modal pop up comes from widget "Knowledge Article Comments". Can someone please help me find out where this code is, so that I can make changes in the content of it.

@Chuck Tomasi  @Pradeep Sharma  @Ankur Bawiskar 

Thanks,

v

find_real_file.png

14 REPLIES 14

@vimal11592 

Thanks for the update.

Please share the solution so that it helps other members as well.

Also close the question as answered by marking your own reply as correct.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Having the same issue, however I do not see any template linked in the widget. Is it possible you could provide any more detail?

Hi @vimal11592,

I am searching in "Knowledge Article Helpful" widget where it is getting populated.

I want to show some thing on selection of "Other".

I haven't found any templates.

Blitz solution will help to add or remove the list. 

Help is highly appreciated.

Thank you

 

blitzburgh79
Giga Expert

I was able to figure this out and would be happy to share the details. There is a script include called 'KBFeedbackTask'. Look at the function 'getReasonValues', it gets the reasons from sys_choice table:

var fb_reason = new GlideRecord('sys_choice');
fb_reason.addQuery('name',"kb_feedback");
fb_reason.addQuery('element',"reason");
fb_reason.addQuery('language',gs.getSession().getLanguage());
fb_reason.query();

You can add/remove/modify the values as needed. TA-DA! That was easy now wasn't it?

find_real_file.png

For bonus points you can override the baseline function getReasonValues in script include KBFeedbackTask to remove inactive sys_choice options:

	getReasonValues : function(){
		var reasons = [];
		
		var fb_reason = new GlideRecord('sys_choice');
		fb_reason.addQuery('name',"kb_feedback");
		fb_reason.addQuery('element',"reason");
		fb_reason.addQuery('inactive','false'); 
		fb_reason.addQuery('language',gs.getSession().getLanguage());
		fb_reason.query();
		
		while(fb_reason.next()){
			var obj = {};
				obj.reason_desc = fb_reason.getDisplayValue('label');
				obj.reason_id = fb_reason.getValue('value');
				reasons.push(obj);
			}
			return new JSON().encode(reasons);
		},

Hopefully this helps somebody. Like and comment below 

Shivaraj G_
Tera Contributor

Modified the template "kb-feedback-task-modal" which comes under "Knowledge Article Content" Widget.

The message in the red box will show only if choice is "Other"

find_real_file.png