KB How "Attach to incident" works ?

pradeepgupta
Giga Expert

Hi All,

While referring Knowledge Article to any incident/problem, how "Attach to incident" button works.

When we click on "Attach to incident" than, knowledge article gets attached to incident/problem, I wanted to understand the working of this button.

Actually I need to do some customization in it, like where to attach, which field of incident will be filled with knowledge article detail etc.

20 REPLIES 20

Is there a way to hide this UI Macro ' kb_view_attach_button" for ITIL users only.


Tried using the DOM manipulation, but didn't work, any suggestions ?


Are you using Knowledge v2 or v3? In v2 you could edit the code of "kb_view" UI Page and wrap the line that invokes the macro into <j2:if>...</j2:if> tags with the appropriate conditions.


Slava Savitsky
Giga Sage

In Eureka, this button is in "kb_view_attach_button" UI macro that is included into "kb_view" UI page. In earlier versions, the code of that button was in "kb_view" UI page itself.



When the button is pressed, it calls "attachIncident2" function that is defined in "KnowledgeFunctions" UI script. Inside that function, there is an asynchronous AJAX call to "KnowledgeAjax" script include that actually creates a link between the task and the article by inserting a record into Knowledge Applied to Tasks [m2m_kb_task] table in the background.



When the link has been created, a callback function "kbReturnAttach2" also defined in "KnowledgeFunctions" UI script is executed. It closes the pop-up window where the article was displayed and updates the fields on the task form.


Thank you Slava, it really helps.



How the customization can be achieved, suppose on click of button I want to call "attachIncident5" instread of "attachIncident2", where should I make a change ?