Create a UI action to enable creating knowledge articles from incidents

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 2분
  • Create a UI action to add the Knowledge check box to the Incident form.

    시작하기 전에

    Role required: admin

    프로시저

    1. Navigate to System UI > UI Actions.
    2. Click New.
    3. Fill in the following fields.
      표 1. UI Action form
      Field Description
      Name Create Knowledge
      Table Incident
      Action name create_knowledge
    4. Select the Client check box.
    5. Select the List v3 Compatible check box.
    6. Select the Form button check box.
    7. In the Onclick field, enter createKnowledgeClient().
    8. In the Condition field, enter gs.getProperty("enable_kcs_incident") == 'true' && new global.CSMTableMapUtil (current).findMapByName("incident_kcs_article") && new global.KBKnowledge().canCreate().
    9. In the Script field, enter the following code.
      function createKnowledgeClient() {
          if (g_form.modified) {
              alert(new GwtMessage().getMessage('You have unsaved changes. Please save them to continue.'));    
          }else{
              //Call the UI Action again but skip the 'onclick' function
              gsftSubmit(null, g_form.getFormElement(), 'create_knowledge');
      //MUST call the 'Action name' set in this UI Action
          }
      }
      
      //Code that runs without 'onclick'
      //Ensure call to server-side function with no browser errors
      if (typeof window == 'undefined')
          CreateKnowledgeServer();
      
      function CreateKnowledgeServer(){
          current.update();
      
          var map = new global.CSMTableMapUtil (current);
          map.findMapByName("incident_kcs_article");
          var targetURL = map.getTargetURL();
              if(targetURL)
              action.setRedirectURL(targetURL[0]);
      }