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:
- Ensured that you are assigned the role of a Project Owner in the project. See Managing access to the server projects.
- Ensured that you are assigned a role as a Team Space Owner in the team space. See Managing members and their roles in a team space.
- Created a project in your team space in HCL OneTest™ Server. See Adding a project.
- Ensured that you are familiar with Apache Velocity. See Apache Velocity Documentation.
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
- Select from the following actions you want to perform:
-
Perform the following steps to configure a project webhook template.
- Log in to HCL OneTest™ Server.
The team space that contains your project is displayed.
- Click
The Overview page of the project is displayed.
to open the project that contains the test assets. - Click
The TEMPLATES tab of Webhooks is displayed.
. - Click New Template.
The New template page is displayed.
- Perform the following actions on the
DETAILS tab:
- Enter a unique name for the template.
- Click the Channel type option, and then select an existing channel type.
- Alternatively, you can create a new channel
type by clicking Create new channel type
icon if there are no webhook templates available in the
drop-down list.
The New channel type dialog is displayed.
- 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 option.
- Perform the following steps if you want to
select either a channel icon or a brand icon:
- Click the Channel type icon .
The Select icon page is displayed.
- View a list of icons that are displayed In the GENERAL tab.
- 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.
- Click the BRANDS tab.
View a list of icons that are displayed.
- 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.
- Click Ok.
The default icon is replaced with the selected icon.
- Click the Channel type icon .
- Enter a description for the channel type, and then
click Apply.
The channel type is created and added to the Channel Type list.
- Enter a description for the template.
- Perform the following steps to select an
event:
- 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
- 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.
- Click This template is suitable for
events and select All Events, or any of the
subset events from the following list:
- Click the TEMPLATES
tab, and then perform any of the following actions:
- Perform the following steps to insert a generic template:
- Click the cloud icon to 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.
- Click Ok.
The text is inserted in the Template body.
- Click the cloud icon to insert a velocity text processing template in
the Template body.
- Perform the following steps to insert a Microsoft Teams sample
template:
- Click the Microsoft Teams icon
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.
- Click Ok.
A Microsoft Teams sample template is inserted in the Template body.
- Click the Microsoft Teams icon
to replace a template with a Microsoft Teams
template.
- Perform the following steps to insert a Slack sample
template:
- Click the Slack icon .
- A message is displayed about the action that replaces the content of the template body with a Slack template.
- Click Ok.
A Slack sample template is inserted in the Template body.
- Perform the following steps to insert a generic template:
- Click Apply.
The template is created and added to the TEMPLATES tab.
- Log in to HCL OneTest™ Server.
-
Perform the following steps to configure a team space webhook template:
- Log in to HCL OneTest™ Server.
The team space that contains your project is displayed.
- Click
The Overview page of the project is displayed.
to open the project that contains the test assets. - Click New Template.
The New template page is displayed.
- Perform the following actions on the
DETAILS tab:
- Enter a unique name for the template.
- Click the Channel type option, and then select an existing channel type.
- Alternatively, you can create a new channel
type by clicking Create new channel type
icon if there are no webhook templates available in the
drop-down list.
The New channel type dialog is displayed.
- 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 option.
- Perform the following steps if you want to
select either a channel icon or a brand icon:
- Click the Channel type icon .
The Select icon page is displayed.
- View a list of icons that are displayed In the GENERAL tab.
- 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.
- Click the BRANDS tab.
View a list of icons that are displayed.
- 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.
- Click Ok.
The default icon is replaced with the selected icon.
- Click the Channel type icon .
- Enter a description for the channel type, and then
click Apply.
The channel type is created and added to the Channel Type list.
- Enter a description for the template.
- Perform the following steps to select an
event:
- 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
- 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.
- Click This template is suitable for
events and select All Events, or any of the
subset events from the following list:
- Click the TEMPLATES
tab, and then perform any of the following actions:
- Perform the following steps to insert a generic template:
- Click the cloud icon to 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.
- Click Ok.
The text is inserted in the Template body.
- Click the cloud icon to insert a velocity text processing template in
the Template body.
- Perform the following steps to insert a Microsoft Teams sample
template:
- Click the Microsoft Teams icon
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.
- Click Ok.
A Microsoft Teams sample template is inserted in the Template body.
- Click the Microsoft Teams icon
to replace a template with a Microsoft Teams
template.
- Perform the following steps to insert a Slack sample
template:
- Click the Slack icon .
- A message is displayed about the action that replaces the content of the template body with a Slack template.
- Click Ok.
A Slack sample template is inserted in the Template body.
- Perform the following steps to insert a generic template:
- Click Apply.
The template is created and added to the TEMPLATES tab.
- Log in to HCL OneTest™ Server.
-
Perform the following steps to configure a server webhook template:
- Log in to HCL OneTest™ Server.
The team space that contains your project is displayed.
- Click
The Overview page of the project is displayed.
to open the project that contains the test assets. - Click the Settings icon on the menu bar.
- Click Webhooks.
The TEMPLATES tab of Webhooks is displayed.
- Click New Template.
The New template page is displayed.
- Perform the following actions on the
DETAILS tab:
- Enter a unique name for the template.
- Click the Channel type option, and then select an existing channel type.
- Alternatively, you can create a new channel
type by clicking Create new channel type
icon if there are no webhook templates available in the
drop-down list.
The New channel type dialog is displayed.
- 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 option.
- Perform the following steps if you want to
select either a channel icon or a brand icon:
- Click the Channel type icon .
The Select icon page is displayed.
- View a list of icons that are displayed In the GENERAL tab.
- 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.
- Click the BRANDS tab.
View a list of icons that are displayed.
- 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.
- Click Ok.
The default icon is replaced with the selected icon.
- Click the Channel type icon .
- Enter a description for the channel type, and then
click Apply.
The channel type is created and added to the Channel Type list.
- Perform the following steps to select an
event:
- 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
- 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.
- Click This template is suitable for
events and select All Events, or any of the
subset events from the following list:
- Click the TEMPLATES
tab, and then perform any of the following actions:
- Perform the following steps to insert a generic template:
- Click the cloud icon to 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.
- Click Ok.
The text is inserted in the Template body.
- Click the cloud icon to insert a velocity text processing template in
the Template body.
- Perform the following steps to insert a Microsoft Teams sample
template:
- Click the Microsoft Teams icon
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.
- Click Ok.
A Microsoft Teams sample template is inserted in the Template body.
- Click the Microsoft Teams icon
to replace a template with a Microsoft Teams
template.
- Perform the following steps to insert a Slack sample
template:
- Click the Slack icon .
- A message is displayed about the action that replaces the content of the template body with a Slack template.
- Click Ok.
A Slack sample template is inserted in the Template body.
- Perform the following steps to insert a generic template:
- Click Apply.
The template is created and added to the TEMPLATES tab.
- Log in to HCL OneTest™ Server.
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.