- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 07:18 PM
Hi All,
I have been trying to create kb article from problem. I see the values on the field - Article Body (html field on kb) is taken as a plain text eventhough the incoming values from problem are line separated.
Any suggestion how can this be fixed
1. Problem
2. Knowledge created without lines
3. Business Rule
var gr= new GlideRecord('kb_knowledge');
gr.initialize();
gr.short_description='From Problem';
gr.text=current.description;
var obj =gr.insert();
gs.addInfoMessage(gr.getDisplayValue()+' : has been created');
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 09:49 PM
You can try
var gr= new GlideRecord('kb_knowledge');
gr.initialize();
gr.short_description='From Problem';
gr.text=current.description.replace(/\n/g,'<br>');
var obj =gr.insert();
gs.addInfoMessage(gr.getDisplayValue()+' : has been created');
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 09:03 PM
Normally KB field gets populated from work notes which supports HTML , any specific reason you are using description?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 03:26 AM
Thats true, I was using the description field just for testing purpose

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2019 09:49 PM
You can try
var gr= new GlideRecord('kb_knowledge');
gr.initialize();
gr.short_description='From Problem';
gr.text=current.description.replace(/\n/g,'<br>');
var obj =gr.insert();
gs.addInfoMessage(gr.getDisplayValue()+' : has been created');
Please mark this response as correct or helpful if it assisted you with your question.