This documentation supports the 23.3 version of BMC Helix ITSM: Service Desk.To view an earlier version, select the version from the Product version menu.

Updating activity template to add custom note type on the Activity tab


For Progressive Web App (PWA) tickets, the following customizable activity templates are provided (in HTML and .JSON formats):

  • SHR_SV_Activity_Template.html (for work orders)
  • SHR_SV_Activity_Template_HPD.html  (for incidents)
  • SHR_SV_Activity_Data_Template.json (for all other modules except incidents and work orders)

To update the activity template for customizing activity notes

As an administrator, you can update the activity templates to customize the activity notes and display custom note type in the activity notes. You can display custom note types by modifying either the HTML templates, or by modifying the HTML and JSON templates.

To display custom note types by modifying the HTML activity templates

  1. Add the following code in SHR_SV_Activity_Template.html (for work orders) and SHR_SV_Activity_Template_HPD.html (for incidents):
    var workLogType = `$<field ID>$`;

    Important

    The field ID is 304422931 for work orders and 304427491l for incidents.

  2. Find the following code:
    messageText = peopleText + valField_0 + ' ' + addedNoteStr + '</br>' + generateLinkForURL(valField_1)
  3. Replace it with the following code:
    messageText = peopleText + valField_0 + ' ' + addedNoteStr + ' ( ' + notetype + ' )' + '</br>' + generateLinkForURL(valField_1);
  4. Add the activity template files in Mid Tier

After performing these steps, you can see the following update in a note on the Activity tab:

Custom Activity notes.png

To display custom note types by updating the HTML and JSON activity templates

  1. Add the following code in SHR_SV_Activity_Template.html and SHR_SV_Activity_Template_HPD.html:
    var notetype = `$<field ID>$`;

    Important

    The field ID is 304422931 for work orders and 304427491 for incidents.

  2. In the SHR_SV_Activity_Data_Template.json file, search for the following code:

    "TEXT_MESSAGES": {
    "ADDED_NOTES": "added a note",
    "SHOW_MORE": "Show more",
    "SHOW_LESS": "Show less",
    "SYSTEM_GENERATED": "System",
    "DAYS": "Day(s)",
    "HOURS": "Hour(s)",
    "MINUTES": "Minute(s)",
    "PRIVATE": "Private",
    "PUBLIC": "Public"
    },
  3. In the ADDED_NOTES line, replace "added a note"  with "added a #noteType# note".
  4. Add this code in SHR_SV_Activity_Template.html and SHR_SV_Activity_Template_HPD.html:

    var noteTypeToken = addedNoteStr.match(/(\#noteType\#)/g);
     if (noteTypeToken && noteTypeToken.length > 0) {
                addedNoteStr = addedNoteStr.replace(noteTypeToken, notetype);
    }else{
                addedNoteStr = addedNoteStr.replace(noteTypeToken, "");
    }
  5. Add the activity template files in Mid Tier

After performing these steps, you can see the following update in a note on the Activity tab:

Custom Activity notes 2.png

To add activity template in Mid Tier and sync cache

  1. Log in to Mid Tier as an administrator.
  2. Navigate to the AR System Resource Definitions Items form by entering the form name in the Mid Tier URL. 

    AR System Definitions.png
  3. Click New search
  4. Enter template name, select Type as Template, and Mime Type as text/html. Click Search.
    Search Template.png
  5. Select the required template and click Add button.
    Activity Template 1.png
  6. Click Replace button to add the updated template.
    Activity Template 2.png
  7. Click Choose field and select the updated template.
    Choose File.png
  8. Click Save.
    AT3.png
  9. After the updated template has been uploaded, log in to the Mid Tier Configuration console. 
  10. Click Cache Settings > Sync Cache.
    Flush Cache.png

Once the cache is synced, you can validate the changes on the PWA screens.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*