Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A number of context variables and methods are available for use in webhook scripts. View suggestions while editing the match script or function editing windows by typing Ctrl + Space. These variables and methods are described below.

Incoming Context Variables

NameDescription
FLX_MESSAGE_ID
Message id as shown on Webhook Messages screen
Unique id for the incoming webhook message
FLX_PRISTINE_PAYLOAD
Payload from webhook eventMethod/Parameters
Pristine (untouched) payload from the sender. Use this payload when generating hmac strings
FLX_REMOTE_ADDRRemote address of the incoming request. If using a reverse proxy, this will be the address of the proxy, NOT the address of the original sender. A reverse proxy will typically pass the original sender address as a new header 'x-forwarded-for'.
FLX_REMOTE_HOSTRemote host of the incoming request. If using a reverse proxy, this will be the host of the proxy, NOT the host of the original sender.
HTTP_HEADERSMap of the incoming request headers. See 'Accessing Map Values' below.
PAYLOAD

Map of incoming payload. See 'Accessing Map Values' below.

If the webhook payload cannot be converted to JSON, it will be passed as a simple string

QUERY_PARAMS

Methods

FLEXDEPLOY

Map of the incoming request query parameters. See 'Accessing Map Values' below.

Outgoing Context Variables

MethodParametersDescription
NameDescription
addFilesToPackageAdd files to a given project package     projectIdId of project package is in     packageNameName of package to add files to     filesFilepaths of files to addaddPackagesToReleaseAdd package(s) to an existing release     releaseNameName of release to add packages to     releaseProjectsA list of release project pojos to add. ****describe pojo*****addProjectsToReleaseAdd project(s) to an existing release     releaseNameRelease name to use     projectIdsList of ids for projects to addapproveTaskSubmits approval for an existing approval task ****should we even document this one???     usernameThe username to request the approval as     taskIdId of the task to approve     notesComment to include with approvalbuildPackageBuild a package for a project. Returns the workflow request id     streamIdThe stream to build, see findStreamId     projectPackagePojo containing package information ****pojo descriptionbuildPackageBuild a package for a project. Returns the workflow request id     streamIdThe stream to build, see findStreamId     projectPackagePojo containing package information ****pojo description     pollingResultPollingResult object to pass to buildMethodDescriptionaddFilesToPackage(projectId, packageName, files)Add files to a package given the project id, package name, and a list of filepaths of files to addaddPackagesToRelease(releaseName, releaseProjects)

HMAC

...

LOG

...

GITHUB

...

BITBUCKET

...

JIRA

...

SLACK

EVENTThe Event payload for the Outgoing Webhook. For more information see Events


Info
titleAccessing Map Values

Map Values can be accessed a number of ways. Here are a few common ones:

  • HTTP_HEADERS['header-key-with-dash']
  • QUERY_PARAMS.paramWithNoDash
  • PAYLOAD.get('key')
  • EVENT.payload.workflowExecutionId

Function Classes (Incoming Webhooks)

ClassDescription
FLEXDEPLOYFunctions for performing actions in FlexDeploy
HMACFunctions for generating an HMAC string
LOGFunctions for printing log messages
GITHUBFunctions for getting information from a GitHub payload
BITBUCKETFunctions for getting information from a Bitbucket payload
SLACKUtility functions for interacting with Slack
GITLABFunctions for getting information from a GitLab payload
BITBUCKET_SERVERFunctions for getting information from a Bitbucket Server payload
AZUREFunctions for getting information from an Azure Git payload
MICROSOFTTEAMSFunctions for receiving Approvals from Teams

Function Classes (Outgoing Webhooks)

ClassDescription
FLEXDEPLOYFunctions for performing actions in FlexDeploy
EMAILFunctions for formatting and sending emails
LOGFunctions for printing log messages
RESTObject exposing REST functions. For more info see Using the REST object.
MICROSOFTTEAMSFunctions for formatting and sending Teams messages
SLACKFunctions for formatting and sending Slack messages