Article Body (text) field in Knowledge Base Articles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 11:05 AM
I import some knowledge articles from another system into a staging form. Now I'm trying to create a new Knowledge Article but the Article Body is blank after my GlideRecord. I've tried a couple of things:
This doesn't work (gr2.text is blank):
var gr = new GlideRecord('u_archive_obim_work_log');
gr.addEncodedQuery('u_new_kb_article_idSTARTSWITHKB0002716^u_kb_status=Published^u_kb_version=NULL');
gr.query();
while(gr.next()){
var gr2 = new GlideRecord('kb_knowledge');
gr2.addQuery('number', gr.u_new_kb_article_id);
gr2.query();
if(gr2.next()){
gr2.text = gr.u_template_question;
gr2.update();
gs.print(gr2.text);
}
}
This doesn't work (gr2.text is blank):
var gr = new GlideRecord('u_archive_obim_work_log');
gr.addEncodedQuery('u_new_kb_article_idSTARTSWITHKB0002716^u_kb_status=Published^u_kb_version=NULL');
gr.query();
while(gr.next()){
var gr2 = new GlideRecord('kb_knowledge');
gr2.addQuery('number', gr.u_new_kb_article_id);
gr2.query();
if(gr2.next()){
var q = gr.u_template_question.toString();
gr2.text = q;
gr2.update();
gs.print(gr2.text);
}
}
This works (but doesn't help me), gr2.text is now "test";
var gr = new GlideRecord('u_archive_obim_work_log');
gr.addEncodedQuery('u_new_kb_article_idSTARTSWITHKB0002716^u_kb_status=Published^u_kb_version=NULL');
gr.query();
while(gr.next()){
var gr2 = new GlideRecord('kb_knowledge');
gr2.addQuery('number', gr.u_new_kb_article_id);
gr2.query();
if(gr2.next()){
gr2.text = "test";
gr2.update();
gs.print(gr2.text);
}
}
I know the Article Body field is a "Translate HTML" field. Is there a way to copy data to this field (not manually). My gr.u_new_kb_article_id was first a string field, then I changed it to an HTML field and it still does not work.
Anyway to do this?
Lisa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 11:25 AM
HI,
Did you go to the knowledge article and see if it has been updated or not?
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 12:58 PM
Yes, the knowledge article itself still has nothing in the Article Body field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 12:53 PM
Is there a create ACL blocking the update?
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 12:59 PM
I don't think so, but I'll check. I updated all the other fields (category, short description) just fine.