Assistance creating a custom Knowledge Feedback Task with correct KA number

LRhodes
Tera Guru

Hi all - little background is that we've enabled Knowledge Feedback Tasks if a user flags a KA, or marks it as unhelpful or gives it a rating of less than 3 stars. Works perfectly well but we also want to generate a task when someone leaves a comment on the article itself. So - I've created its own business rule on insert which works well up until a point.

 

So as below when I leave a comment it generates the below knowledge feedback record OOTB. What I want to do with this is then generate a Knowledge Feedback Task.

 

LRhodes_0-1689780383925.png

 

The below script creates the task perfectly fine however I'm having a bit of trouble sending over the data from the Article field.

(function executeRule(current, previous /*null when async*/) {

	var kft = new GlideRecord('kb_feedback_task');
	kft.initialize();
	kft.opened_by = current.user;
	kft.article = current.article.getDisplayValue();
	kft.feedback_task_type = '5';
	kft.description = current.comments;
	kft.insert();	

})(current, previous);

 

When I look at the task its created everything else has worked fine apart from the Article.

LRhodes_1-1689781075296.png

 

Am I using the correct script line? I'm wondering if perhaps it may be because the field is read-only, but submitted by and feedback task type do not have the same problem.

 

Thanks in advance!

1 ACCEPTED SOLUTION

Arun_S1
Tera Guru
Tera Guru

@LRhodes Kindly try modifying the below line in your BR

 

kft.article = current.article.getDisplayValue();

 

 Please change this line to 

 

kft.feedback= current.sys_id;

 

 

Knowledge Feedback Task table does not have a field called Article, instead it has a reference to the feedback that is submitted and the article number is shown from the feedback that is associated.

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

View solution in original post

3 REPLIES 3

Arun_S1
Tera Guru
Tera Guru

@LRhodes Kindly try modifying the below line in your BR

 

kft.article = current.article.getDisplayValue();

 

 Please change this line to 

 

kft.feedback= current.sys_id;

 

 

Knowledge Feedback Task table does not have a field called Article, instead it has a reference to the feedback that is submitted and the article number is shown from the feedback that is associated.

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

Thank you Arun - for the resolution and the explanation.

flsn2
Tera Expert

Hi can you tell me what are your trigger conditions i need to make the samething thanks !!