Configuring a webhook template

You can configure a project, team space and a server webhook template on HCL OneTest Server to send notifications to the configured messaging application.

Before you begin

You must have completed the following tasks:

About this task

You can create a template based on the channel type that you configured. You can select a generic template to send notifications to the generic application. You can also select a JSON sample template with specific fields defined to display event-related notifications in Microsoft Teams or Slack. You can use the sample template that is available for the messaging application or you can also define a JSON template to post the message about the events that occur on HCL OneTest Server.

Procedure

  1. Select from the following actions you want to perform:
    • Configure a project webhook template. Go to Step 2.
    • Configure a team space webhook template. Go to Step 3.
    • Configure a server webhook template. Go to Step 4.
  2. Perform the following steps to configure a project webhook template.
    1. Log in to HCL OneTest Server.

      The team space that contains your project is displayed.

    2. Click Active projects > My projects > project_name to open the project that contains the test assets.

      The Overview page of the project is displayed.

    3. Click Manage > Webhooks.

      The TEMPLATES tab of Webhooks is displayed.

    4. Click New Template.

      The New template page is displayed.

    5. Perform the following actions on the DETAILS tab:
      1. Enter a unique name for the template.
      2. Click the Channel type option, and then select an existing channel type.
      3. Alternatively, you can create a new channel type by clicking Create new channel type icon create channel type if there are no webhook templates available in the drop-down list.

        The New channel type dialog is displayed.

      4. Enter a unique name for the channel type, and then enter a description for the channel type.
        Note: You can also create a new channel type or edit a channel type from Webhooks > TEMPLATES > Edit channel type option.
    6. Perform the following steps if you want to select either a channel icon or a brand icon:
      1. Click the Channel type icon default icon.

        The Select icon page is displayed.

      2. View a list of icons that are displayed In the GENERAL tab.
      3. Search for the icons by entering any text contained in the icon name in the Search field, and then select the required icon.

        The selected icon is displayed in the Selected icon box.

      4. Click the BRANDS tab.

        View a list of icons that are displayed.

      5. Search for the brands by entering any text contained in the brand name in the Search field, and then select the brand.

        The selected brand is displayed in the Selected icon box.

      6. Click Ok.

        The default icon is replaced with the selected icon.

    7. Enter a description for the channel type, and then click Apply.

      The channel type is created and added to the Channel Type list.

    8. Enter a description for the template.
    9. Perform the following steps to select an event:
      1. Click This template is suitable for events and select All Events, or any of the subset events from the following list:
        • All Events
        • Team Space Events
        • Project Events
        • Execution Events
        • License Events
      2. Search for the events by entering any text contained in the events name in the Search field, and then select the corresponding checkbox to select the specific event.
        Note: All Events is the default event that is set for the webhook template.
    10. Click the TEMPLATES tab, and then perform any of the following actions:
      1. Perform the following steps to insert a generic template:
        1. Click the cloud icon cloud templateto insert a velocity text processing template in the Template body.

          A message is displayed about the action that inserts a text in the template body.

        2. Click Ok.

          The text is inserted in the Template body.

      2. Perform the following steps to insert a Microsoft Teams sample template:
        1. Click the Microsoft Teams icon Teams template to replace a template with a Microsoft Teams template.

          A message is displayed about the action that replaces the content of the template body with a Microsoft Teams template.

        2. Click Ok.

          A Microsoft Teams sample template is inserted in the Template body.

      3. Perform the following steps to insert a Slack sample template:
        1. Click the Slack icon slack template.
        2. A message is displayed about the action that replaces the content of the template body with a Slack template.
        3. Click Ok.

          A Slack sample template is inserted in the Template body.

    11. Click Apply.

      The template is created and added to the TEMPLATES tab.

  3. Perform the following steps to configure a team space webhook template:
    1. Log in to HCL OneTest Server.

      The team space that contains your project is displayed.

    2. Click Active projects > My projects > project_name to open the project that contains the test assets.

      The Overview page of the project is displayed.

    3. Click New Template.

      The New template page is displayed.

    4. Perform the following actions on the DETAILS tab:
      1. Enter a unique name for the template.
      2. Click the Channel type option, and then select an existing channel type.
      3. Alternatively, you can create a new channel type by clicking Create new channel type icon create channel type if there are no webhook templates available in the drop-down list.

        The New channel type dialog is displayed.

      4. Enter a unique name for the channel type, and then enter a description for the channel type.
        Note: You can also create a new channel type or edit a channel type from Webhooks > TEMPLATES > Edit channel type option.
    5. Perform the following steps if you want to select either a channel icon or a brand icon:
      1. Click the Channel type icon default icon.

        The Select icon page is displayed.

      2. View a list of icons that are displayed In the GENERAL tab.
      3. Search for the icons by entering any text contained in the icon name in the Search field, and then select the required icon.

        The selected icon is displayed in the Selected icon box.

      4. Click the BRANDS tab.

        View a list of icons that are displayed.

      5. Search for the brands by entering any text contained in the brand name in the Search field, and then select the brand.

        The selected brand is displayed in the Selected icon box.

      6. Click Ok.

        The default icon is replaced with the selected icon.

    6. Enter a description for the channel type, and then click Apply.

      The channel type is created and added to the Channel Type list.

    7. Enter a description for the template.
    8. Perform the following steps to select an event:
      1. Click This template is suitable for events and select All Events, or any of the subset events from the following list:
        • All Events
        • Team Space Events
        • Project Events
        • Execution Events
        • License Events
      2. Search for the events by entering any text contained in the events name in the Search field, and then select the corresponding checkbox to select the specific event.
        Note: All Events is the default event that is set for the webhook template.
    9. Click the TEMPLATES tab, and then perform any of the following actions:
      1. Perform the following steps to insert a generic template:
        1. Click the cloud icon cloud templateto insert a velocity text processing template in the Template body.

          A message is displayed about the action that inserts a text in the template body.

        2. Click Ok.

          The text is inserted in the Template body.

      2. Perform the following steps to insert a Microsoft Teams sample template:
        1. Click the Microsoft Teams icon Teams template to replace a template with a Microsoft Teams template.

          A message is displayed about the action that replaces the content of the template body with a Microsoft Teams template.

        2. Click Ok.

          A Microsoft Teams sample template is inserted in the Template body.

      3. Perform the following steps to insert a Slack sample template:
        1. Click the Slack icon slack template.
        2. A message is displayed about the action that replaces the content of the template body with a Slack template.
        3. Click Ok.

          A Slack sample template is inserted in the Template body.

    10. Click Apply.

      The template is created and added to the TEMPLATES tab.

  4. Perform the following steps to configure a server webhook template:
    1. Log in to HCL OneTest Server.

      The team space that contains your project is displayed.

    2. Click Active projects > My projects > project_name to open the project that contains the test assets.

      The Overview page of the project is displayed.

    3. Click the Settings settings icon icon on the menu bar.
    4. Click Webhooks.

      The TEMPLATES tab of Webhooks is displayed.

    5. Click New Template.

      The New template page is displayed.

    6. Perform the following actions on the DETAILS tab:
      1. Enter a unique name for the template.
      2. Click the Channel type option, and then select an existing channel type.
      3. Alternatively, you can create a new channel type by clicking Create new channel type icon create channel type if there are no webhook templates available in the drop-down list.

        The New channel type dialog is displayed.

      4. Enter a unique name for the channel type, and then enter a description for the channel type.
        Note: You can also create a new channel type or edit a channel type from Webhooks > TEMPLATES > Edit channel type option.
    7. Perform the following steps if you want to select either a channel icon or a brand icon:
      1. Click the Channel type icon default icon.

        The Select icon page is displayed.

      2. View a list of icons that are displayed In the GENERAL tab.
      3. Search for the icons by entering any text contained in the icon name in the Search field, and then select the required icon.

        The selected icon is displayed in the Selected icon box.

      4. Click the BRANDS tab.

        View a list of icons that are displayed.

      5. Search for the brands by entering any text contained in the brand name in the Search field, and then select the brand.

        The selected brand is displayed in the Selected icon box.

      6. Click Ok.

        The default icon is replaced with the selected icon.

    8. Enter a description for the channel type, and then click Apply.

      The channel type is created and added to the Channel Type list.

    9. Perform the following steps to select an event:
      1. Click This template is suitable for events and select All Events, or any of the subset events from the following list:
        • All Events
        • Team Space Events
        • Project Events
        • Execution Events
        • License Events
      2. Search for the events by entering any text contained in the events name in the Search field, and then select the corresponding checkbox to select the specific event.
        Note: All Events is the default event that is set for the webhook template.
    10. Click the TEMPLATES tab, and then perform any of the following actions:
      1. Perform the following steps to insert a generic template:
        1. Click the cloud icon cloud templateto insert a velocity text processing template in the Template body.

          A message is displayed about the action that inserts a text in the template body.

        2. Click Ok.

          The text is inserted in the Template body.

      2. Perform the following steps to insert a Microsoft Teams sample template:
        1. Click the Microsoft Teams icon Teams template to replace a template with a Microsoft Teams template.

          A message is displayed about the action that replaces the content of the template body with a Microsoft Teams template.

        2. Click Ok.

          A Microsoft Teams sample template is inserted in the Template body.

      3. Perform the following steps to insert a Slack sample template:
        1. Click the Slack icon slack template.
        2. A message is displayed about the action that replaces the content of the template body with a Slack template.
        3. Click Ok.

          A Slack sample template is inserted in the Template body.

    11. Click Apply.

      The template is created and added to the TEMPLATES tab.

Results

You have configured and created a project, team space and a server webhook template on HCL OneTest Server.

What to do next

You must configure a webhook to push the events from HCL OneTest Server to the messaging application. See Configuring a project webhook.