Set up a webhook(设置 Webhook)¶
Prerequisites¶
- Complete the getting started tutorial to learn about how to set up a basic action.
- Set up a webhook to create a connection to an external system. You may need to work with a system administrator who has permissions to connect to source systems before creating a webhook.
Steps¶
In the below example, suppose that we have a webhook called Modify ticket priority which accepts a priority string value and sends it to an external system.
Navigate to your action, select the Logic tab, select Add new rule, then select Webhook.

By default, the newly added webhook is configured as a side effect; this makes the webhook run after objects are edited in Foundry. Alternatively, select Writeback to have the webhook run before object edits.

In the menu below, select the webhook you want to execute. In this example, we select the Modify ticket priority webhook. If you wish, you can select a different version of the webhook.

Next, configure webhook input parameters based on action parameters. By default, a new action parameter is generated for each webhook input unless an existing action parameter with the same name already exists, in which case the existing parameter is automatically configured. In this example, we map the webhook input called priority to an existing action parameter called Ticket Priority.

Select Add webhook to complete adding the webhook rule to your action. Note that after the webhook is added, the Rules section shows that the writeback will occur before objects are modified.

You may want to remove any autogenerated parameters created when you added the webhook which are now unused.

Select Save in the top-right to save your changes to the action. Now, when the action is applied, the request to the external system will be made before any changes are applied to objects in Foundry.
Next steps¶
This tutorial demonstrated how to add a webhook to an action. To learn more, try these resources:
- View the webhooks section to learn about all the options available for webhooks in actions.
- Learn how to configure webhook input parameters using functions.
- Learn more about the webhooks concept in Data Connection.
中文翻译¶
设置 Webhook¶
前提条件¶
操作步骤¶
在以下示例中,假设我们有一个名为 修改工单优先级(Modify ticket priority)的 webhook,它接受一个 priority 字符串值并将其发送到外部系统。
导航到您的操作,选择 逻辑(Logic)选项卡,选择 添加新规则(Add new rule),然后选择 Webhook。

默认情况下,新添加的 webhook 被配置为副作用(side effect);这使得 webhook 在 Foundry 中编辑对象之后运行。或者,选择 回写(Writeback)让 webhook 在对象编辑之前运行。

在下面的菜单中,选择要执行的 webhook。在本示例中,我们选择 修改工单优先级 webhook。如果需要,您可以选择不同版本的 webhook。

接下来,根据操作参数配置 webhook 输入参数。默认情况下,会为每个 webhook 输入生成一个新的操作参数,除非已存在同名的现有操作参数,在这种情况下会自动配置现有参数。在本示例中,我们将名为 priority 的 webhook 输入映射到名为 工单优先级(Ticket Priority)的现有操作参数。

选择 添加 webhook(Add webhook)完成将 webhook 规则添加到操作中。请注意,添加 webhook 后,规则(Rules)部分会显示回写将在对象修改之前发生。

您可能希望删除添加 webhook 时创建的任何自动生成但现已未使用的参数。

选择右上角的 保存(Save)以保存对操作的更改。现在,当应用操作时,将在对 Foundry 中的对象应用任何更改之前向外部系统发出请求。
后续步骤¶
本教程演示了如何向操作添加 webhook。要了解更多信息,请尝试以下资源:
- 查看 webhooks 部分,了解操作中 webhook 的所有可用选项。
- 了解如何使用函数配置 webhook 输入参数。
- 进一步了解数据连接(Data Connection)中的 webhook 概念。