Class: WebhookClient

WebhookClient(jiraClient)

new WebhookClient(jiraClient)

Used to access Jira REST endpoints in '/rest/webhook/1.0/webhook'

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

createWebhook(opts, callbackopt) → {Promise}

Registers a new webhook.

Parameters:
Name Type Attributes Description
opts

The options sent to the JIRA API.

Properties
Name Type Description
name

The name of the webhook.

url

The URL of the webhook.

events

An array of events with which the webhook should be registered. See https://developer.atlassian.com/jiradev/jira-apis/webhooks#Webhooks-configureConfiguringawebhook.

enabled

Whether the webhook is enabled.

filter

An object containing filter configuration.

Properties
Name Type Description
issue-related-events-section

A filter for issues, written in JQL.

excludeBody

Whether to send an empty body to the webhook URL.

callback <optional>

Called when the webhook has been retrieved.

Source:
Returns:

Resolved when the webhook has been retrieved.

Type
Promise

deleteWebhook(opts, callbackopt) → {Promise}

Deletes a registered webhook.

Parameters:
Name Type Attributes Description
opts

The options sent to the JIRA API.

Properties
Name Type Description
webhookId

The numerical webhook ID.

callback <optional>

Called when the webhook has been retrieved.

Source:
Returns:

Resolved when the webhook has been retrieved.

Type
Promise

getAllWebhooks(opts, callbackopt) → {Promise}

Returns a list of all registered webhooks.

Parameters:
Name Type Attributes Description
opts

Ignored

callback <optional>

Called when the webhooks have been retrieved.

Source:
Returns:

Resolved when the webhooks have been retrieved.

Type
Promise

getWebhook(opts, callbackopt) → {Promise}

Returns a webhook with a specific ID.

Parameters:
Name Type Attributes Description
opts

The options sent to the JIRA API.

Properties
Name Type Description
webhookId

The numerical webhook ID.

callback <optional>

Called when the webhook has been retrieved.

Source:
Returns:

Resolved when the webhook has been retrieved.

Type
Promise