- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2014 12:28 AM
Hello all,
The article view count and use count increases each time the article is attached to incident.
It is out of box functionality.Can somebody explain from where it triggers to increase the count.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- 23,027 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2014 01:15 AM
Hi Lakshmi,
The 'Attach to Incident' button comes from the UI Macro called 'kb_view_attach_button'.
Which calls a client JavaScript function named 'attachIncident2' in the UI Script 'KnowledgeFunctions'.
This in turn calls the function 'kbAttachArticle' of a Script Include called 'KnowledgeAjax'.
Inside the script include, an event is fired called kb.use and this event is picked up by a System Policy>Script Action named 'Knowledge Use' which creates a new record in the kb_use table indicating the kb has been used in an incident.
The use_count field on the kb_knowledge table isn't actually used for keeping this count, although you could quite easily use a business rule on the kb_use table to keep it sync'd.
The view count is stored in the sys_view_count field of the kb_knowledge record and is incremented whenever the article is viewed via kb_view.do
Hope this helps
Andy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2014 01:20 AM
View Count and Use Count are the integer fields of table kb_knowledge.
Whenever any article is previewed, UI page kb_preview opens and executes below code to increment the view count.
var kb = new GlideRecord('kb_knowledge');
kb.initialize();
kb.get(jelly.sys_kb_id);
if (kb.short_description.nil())
kb.short_description = '(' + gs.getMessage('Short description empty') + ')';
gs.eventQueue('user.view', kb, kb.getDisplayValue(), gs.getUserID());
gs.eventQueue('kb.view', kb, kb.getDisplayValue(), gs.getUserID());
kb.incrementViewCount();
Whenever any article is opened(not preview) , UI page kb_view opens and executes below code.
<!-- outputs an article's footer info: link, viewcount -->
<table class="wide" cellspacing="0">
<tr><td style="color:#999999; font-size:80%; padding-top:8px;">
<g:inline template="kb_article_footer.xml" />
</td></tr>
</table>
kb_article_footer.xml is the inbuilt page they have designed which calculates the view count.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2014 02:39 AM
Thank you:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 05:34 AM
Hi Bhavesh.
Whenever any article is previewed the view count number increments. Does it mean that the view count number increments across all article versions? So, the view count visible on the latest KB article version form is a cumulative value from all article versions?
Example:
Article Version 1 - 4 views
Article Version 2 - 10 views = 4 views(from version 1) + 6 views (version 2)
Article Version 3 - 12 views = 10 views (from the version 1 and 2) + 2 views (version 3)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:51 PM
FYI - I heard Use Count will be fixed in Jakarta...yea!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2017 04:17 AM
Hi Everyone!
i have a question, in our DEV environment the kb_use.viewed is getting updated to true according to the view count, but in our QA and prod. it doesn't (stays as false regardless to the view count).
we cloned QA and DEV at about the same time (1 day apart) after knowledge V.3 and upgrading to Jakarta.
any clues on where i can find the missing link?
thanks!
M