Webhook Functions

Webhook Functions are groovy scripts which are executed when a webhook is received by FlexDeploy. Incoming webhook messages are matched to a Function first by matching to a provider, then by the Function's URI. Each webhook provider may have multiple Functions, and multiple Functions may be executed for one incoming message, though the order of execution is indeterminate.

Viewing Webhook Functions

Access functions from the menu at Administration → Incoming Webhooks and clicking the Configuration button in the top right of the page. To view the Functions belonging to a Provider, select the dropdown arrow on the left of a Provider row.

Function Actions

  • Clicking the icons in the Active column will activate/inactivate the Function in that row.

  • In the context menu in the Actions column, you can edit the Function, copy the Function’s Id, and delete the Function.

Creating/Editing Webhook Functions

To create a new Function, click the button at the top right of the table, or, to create a Function directly for a Provider, select create function from the context menu of a Provider row in the Actions column. To view or edit a Function, click on the name of the Function or access from the context menu in the Actions column.

Field

Description

Field

Description

Name

The name of the function

Provider

Provider the function is for. Can not be changed after creation

Description

The description for the function

Uri

Path webhook will be sent (appended to /flexdeploy/webhooks/v2)

Active

Whether or not the function is active (Defaults to Yes)

Groovy Script

The Groovy script for the Function will be executed when a webhook is received at the listed URI that has been matched to the selected Provider. The editing window has capabilities for undo, redo, find, find and replace, and go to line. There are a variety of context variables and methods available to use in this script. Properties defined by the Function’s Provider can also be used within this script. Type Ctrl + Space in the editor for suggestions on variables and methods that can be used. See more examples of Functions on our Sample Implementations page.

 

The following macros are not currently supported in the footer:
  • style