- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 04:27 PM
Is it possible to add a new button for example Create HR Case to the knowledge view? The functionality will be similar to Create Incident. Thanks in advance for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2016 03:44 PM
Doing some Developper console exploring, I found that the script that handles the createIncident button reside in the UI Script "KBViewArticle"
So you have: $j('#createIncident').click(this.incidentBtnHandler.bind(this));which handles the click of the button
Then the incidentBtnHandler function uses $j('#createIncidentLinkLocation').val(); to set the location
The #createIncidentLinkLocation refers to an hidden input field which is contained inside "kb_view_hidden_fields" UI Macro.
This createIncidentLinkLocation is based on the System property (sys_properties.list in SNOW navigator). This link looks a lot like what I suggested which is: "incident.do?sys_id=-1&sysparm_query=active=true^comments=(Created after Knowledge search: $[HTML:knowledgeRecord.short_description])&sysparm_stack=knowledge_home_launcher.do"
The important part in the link is the "$[HTML:knowledgeRecord.short_description]" part. Inside "kb_..." UI Macro you have access to knowledgeRecord jelly object which contains all your knowledge fields which you may want to use for your predefined values.You usually can use it in first phase ${knowledgeRecord.field} or in second phase $[knowledgeRecord.field]
So if you want to create your button the same way the create incident is done you would need to customize:
- 3 UI Macro (kb_view_common_header_toolbar & kb_view_hidden_fields & kb_view_common in which the variable showCreateIncident is initialized based on the fact that the knowledge is in a popup or not)
- 1 UI Script (KBViewArticle)
- Insert a new system property
This has the pro of respecting the actual design but have the con of making a lot of modifications that can be harder to maintain than simply putting a onclick on your button.
Depending on your level of expertise in ServiceNow and with Jelly, I think I gave you enough info to do it yourself, but if you need more help, just ask.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 12:17 AM
Thanks laurentchicoine. We have confirmed this from ServiceNow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 02:22 AM
Hi Laurent!
Im really in a need to get this button in to our environment, especially in to our 1st level supporters knowledge base.
What do you mean by the "J release" ? Is that code name for Istanbul or what?
Thanks for reply!
br. Anna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 06:04 AM
J release is the Jakarta release that is following Istanbul.
It will be announced at Knowledge17 which is next week.
So unless this is really urgent to you, I would recommend to wait for your upgrade to that version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2017 10:01 PM
Yeah of course it is Jakarta..how stupid of me.
It is just that according to our dev team we are gonna update to Istanbul approx in Sep 2017, so i assume we will be waiting for the J for at least over a year from now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 01:09 PM
Hi Laurent,
Can you help me out regarding this below Question. Thanks in Advance!
https://community.servicenow.com/thread/273301
Thanks,
Arindam