Comments on: Mandatory Knowledge Search Before Ticket Creation https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 19:51:17 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Ketan Bhagwat https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9262 Wed, 01 Apr 2015 13:07:30 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9262 I recently came across same situation, i used below script

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue == '') {
      return;
   }
   customKBPopup(newValue.toString());
}

function customKBPopup(searchText) {
   var url = 'kb_find.do?sysparm_search=' + encodeURI(searchText);
   url += "&sysparm_nameofstack=kbpop";
   url += "&sysparm_kb_search_table=" + g_form.getTableName();
   url += "&sysparm_operator=IR_AND_OR_QUERY";
   popupOpenStandard(url, 'kb2task');
}
]]>
By: pattipdx https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9261 Fri, 05 Sep 2014 21:27:16 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9261 It worked like a charm! Thanks for sharing.
@pattipdx

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9260 Wed, 16 Jul 2014 12:46:45 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9260 In reply to Sayan.

The search results can be displayed in the same page, but the solution to do that is much more complex, and accomplished in a completely different way. Crossfuze Solutions does that in their Knowledge Turnkey solution and it works very well. You can take a look at the Knowledge product here and request a demo if you like.

http://www.crossfuze.com/solutions/turnkey-solutions

]]>
By: Sayan https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9259 Wed, 16 Jul 2014 09:27:33 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9259 Hi Mark,
Thanks for the solution. This is exactly what I have been looking for. There is something though I was wondering if it could be done. The Search pops up in a new window. Can the search results be displayed in the same page ?

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9258 Wed, 26 Mar 2014 12:52:07 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9258 In reply to Adam Domanski.

Hey Adam, I actually haven’t found a way around that. You may need to contact ServiceNow support on that one.

]]>
By: Adam Domanski https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9257 Wed, 26 Mar 2014 12:05:21 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9257 Hi Mark, this is a great feature and I’ve been looking at implementing it in our instance. One snag we have found, however, is that to be able to use the “Attach To Incident” button, the record needs to have been saved first. The problem here is that we’d like the immediacy of being to raise Incidents and save them as First-Time fix in one go, and of course having to save Incident first before attaching Knowledge hinders this. This behavior is understandable from a database perspective, however, as the Incident needs to be saved to be able to build a relationship to it. Have you been able to find a way around this?

]]>
By: Rick Mann https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9256 Mon, 07 Oct 2013 19:59:24 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9256 In reply to Slava Savitsky.

Slava – Great post. Did you write the script include yourself or were you calling one of the existing Knowledge script includes? This will be very handy for our Service Desk.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9255 Fri, 25 Jan 2013 00:19:53 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9255 In reply to Chris Devine.

YES!!! Thanks for the assist Chris! I just updated the code above so that this works from standard forms again using your workaround.

]]>
By: Chris Devine https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9254 Thu, 24 Jan 2013 23:52:57 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9254 Hello Mark, you could create a custom function and add it to the end of the onload script and then call it instead of kbPopup. I’ve added the line sysparm_kb_search_table to what kbPopup used to do as I can see that is what is done in Berlin (instance name/scripts/elements/element_attribute_knowledge.jsx). In Berlin it looks like encodeURIComponent is used instead of encodeURI so that could be changed in the customKbPopup too.

function customKbPopup(me) {
   self.fillField = me;
   var shortElement = gel(me);
   var searchText = shortElement.value;
   var url = 'kb_find.do?sysparm_search=' + encodeURI(searchText);
   url += "&sysparm_nameofstack=kbpop";
   url += "&sysparm_kb_search_table=" + g_form.getTableName();
   url += "&sysparm_operator=IR_AND_OR_QUERY";
   popupOpenStandard(url, "kb2task");
}
]]>
By: Josh https://servicenowguru.com/client-scripts-scripting/mandatory-knowledge-search-ticket-creation/#comment-9253 Mon, 14 Jan 2013 18:59:00 +0000 https://servicenowguru.wpengine.com/?p=4399#comment-9253 In reply to Slava Savitsky.

Slava, your idea to use popupOpenStandard worked well. I did have to modify it a bit to work by putting this inside the popupOpenStandard:

“…sysparm_search=”+g_form.getValue(‘short_description’)+”…”

]]>