How to get Description,Resolution note,Additional info and additional comment in the article body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 12:21 AM - edited 05-17-2024 07:03 AM
HI
How to get the Description, Resolution note and last additional comment in the article body of kb article created by incident.
Created a knowledge article from an incident is resolved. (without plugin)
In BR "incident create knowledge', wrote a line '
it is coming as
can you help me to get the additional info same as like description by coming in the same line ?
Thanks
@Community Alums @Arpan Baishya @VaishnaviShinde @Kieran Anson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 12:45 AM - edited 05-17-2024 12:46 AM
Even though you didn't ask me, it could be something like this. Just check on your field names and also if everything is transferred to the correct format.
var desc = current.description.getHTMLValue();
var resolution = current.resolution_notes.getHTMLValue();
var comment = current.comments.getJournalEntry(1).replace(/n+/g, '\n').trim();
kb.text = desc + '\n\n' + resolution + '\n\n' + comment;
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 06:58 AM
Hi @Mark Manders ,
\n is not working.
tried with
can you help me to get the additional info same as like description by coming in the same line ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 03:34 AM
It looks like there already is a hard line break in the comments.
But: for a knowledge article, wouldn't it be better to put the text under the field? It's often multi line information and it gives a better overview if you don't put them on the same line.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 03:53 AM
HI,
Yes. It is fine as it is defined as paragraph in HTML.
Thanks