Populate article number in kb_feedback_task table

bhavana2
Mega Contributor

Hi All,

There is a catalog item called "submit feedback" in which if user submits this form it will create an feedback task record in kb_feedback_task table.  Once it is submitted i have to map the article number field to the Article field in feedback task table.  But is not mapping correctly and coming empty. Apart from that i am able to map the author, desc and other fields.

I am using "current.article= producer.article_number;"   // inorder to map the "Article" field 

 since it is reference field i used  "current.feedback.article= producer.article_number;"

 But still it is not working. Can i know where i am doing wrong?

 Please let me know as it urgent requirement.  Early responses are highly appreciated

 

Thanks,

 Deepa

 

1 ACCEPTED SOLUTION

Ravi9
ServiceNow Employee
ServiceNow Employee

what is ur target table in rec prod ?

is it kb_feedback_task

then change the current.article = createdFeedbackFirst; TO

current.feedback = createdFeedbackFirst;

also ur code can be much simpler as well , something like below

var getNumber = producer.knowledge_article_number; // Article Number Variable here

current.feedback = createdFeedback(getNumber);

function createdFeedback(sys_id) {
  var gr = new GlideRecord("kb_feedback");
  gr.initialize();
  gr.article = sys_id;
  return gr.insert();
}

let me know

View solution in original post

15 REPLIES 15

sachin_namjoshi
Kilo Patron
Kilo Patron

Is your record producer variable is reference to kb_knowledge table?

If yes, you can use below sample code

 

current.article= producer.article_number; // you need sys_id of kb_knowledge record in your record producer variable.

 

Regards,

Sachin

Hi Sachin,

Ya it is  referencing to kb_knowledge table and used the same code but it is not mapping

chrisperry
Giga Sage

Hi there,

 

I do not see an OOTB field with column name = 'article' on the kb_feedback_task table.

Are you trying to set the OOTB field 'outcome' which references the Knowledge Article (kb_knowledge) table?

If this answer is helpful please mark correct and helpful!

Regards,

Christopher Perry

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

Hi Christopherperry,

find_real_file.png

 

Here is the snapshot of that and when i rightclick on Article the backend value of that is article. and if i see in "show article" 

find_real_file.png

  the backend value is feedback.

 

I am not sure what is the exact backend value and i tried to populate the same article  value in description of feedback and it worked.