Administer > Smart Analytics Administration > Tailoring > Customize actions in hot topic map

Customize actions in hot topic map

User Role: Administrator

If you want to customize the actions available in the hot topic map, you can tailor the out-of-box Hot Topic Analytics. For example, for the out-of-box Hot Topic Analytics for Incidents, the Create Problem action (button) is available. You can change this action or add a new action according to your business needs.

To customize the actions in hot topic map, follow these steps:

  1. Click Tailoring > Script Library.
  2. In the Name field, type IDOLModuleConfiguration, and then click Search. The detailed script is displayed.
  3. Locate the "MODULE_CONFIGS" Javascript Object. Inside MODULE_CONFIGS, you can see the configuration entries for different modules. The entry "key" must correspond to the table name of an SM module. For example: "probsummary."

    The "actions" configuration section is a Javascript array. The items defined in this array will be rendered as "the action button" in the Hot Topic Analytics chart. For example, you can see the following lines in the script:

       actions : [{
         id: 'idol-action-list',
         text: scmsg(1023, 'idol'),
         aria: scmsg(1023, 'idol'),
         process: 'idol.hot.topic.view'
       }, {
         id: 'idol-action-link-incident',
         text: scmsg(1025, 'idol'),
         aria: scmsg(1025, 'idol'),
         process: function() {
           return PDE.isIncidentEnabled() ? 'idol.hot.topic.create.pd.incident' : 'idol.hot.topic.create.incident';
         }
       }]
    
  4. Modify the "actions" configuration section to add the definition for the new action. The parameters that you need to specify are described in the following table.

    Parameter Description
    id

    A unique value to identify which "action button" is clicked. The "id" value also has the CSS style attached. Currently, two styles are available:

    • "idol-action-list" has an "Open" icon.
    • "idol-action-link" has a "Link" icon.
    text The "action button" label that is displayed on the chart
    aria Texts used for accessibility
    process

    Represents the SM process name. The process is invoked when the "action button" is clicked. The configuration value can be either a text string or a function that returns a text string. When the process is invoked, two additional variables are available:

    • "$L.idol.selected.filename": the current module table name
    • "$L.idol.selected.query": the SM query to retrieve the selected records in the Hot Topic Analytics chart

    For example, you can modify the following lines accordingly and add them to the script:

    {  
       id: 'idol-action-link-others',
       text : 'Link to some other module',
       aria : 'Link to some other module',
       process : 'idol.link.to.other.module'
     }
    
  5. Click Save to save your change in the script file.
  6. Create the process that you use for the new action button. For example, you need to create the "idol.link.to.other.module" process that you specified in step 4. In the process, you can define the behaviors when the action button is clicked.

Add more "Analytics Action" queries in the Hot Topic Analytics for Incidents

In the out-of-box system, the Analytics Action setting in the Hot Topic Analytics for incidents include the following three out-of-box action queries: Set Parent, Create Problem, and Create Change/Article.

If you want to add more custom action queries in the Hot Topic Analytics for Incidents, follow these steps:

  1. Tailor the form of the Hot Topic Analtyics for Incidents to add one more option to the drop-down list of "Analytics Action".

  2. Add the new action to the "IDOL HTA Action Type" globallist that is used in the Hot Topic Analytics configuration record for the Incident module.

  3. In the Advanced tab of the Hot Topic Analytics configuration record for Incidents, select the new action that you added, and then define the query for this newly added action.

    Tip The query also supports jscall function.

  4. From the script library, open "IDOLModuleConfiguration" and then configure which actions can be shown in the action form. For example:

     if (vars['$hta.analytics.action']==="createproblem") {
              return [list, createProblem];
            }