Webhook Trigger

Webhook trigger

Trigger scripts via external HTTP requests. One per script (singleton).

Webhook triggers allow external systems, CI/CD pipelines, monitoring tools, and other services to execute scripts by sending HTTP requests to a unique URL with Basic Auth credentials.

Configuration

Setting Description
Methods Allowed HTTP methods (GET, POST, PUT, DELETE). At least one is required; a new trigger starts with GET only
Description Optional description (up to 2,000 characters)

Authentication

Each webhook trigger has a unique token managed in the Web Trigger Authentication panel of the script’s Config tab (save the script first). The panel shows the URL, the Webhook ID and, once, the token. Authentication uses Basic Auth:

Authorization: Basic base64(webhookId:token)

Where webhookId is the trigger’s unique identifier and token is the generated secret.


Token management

  • Generate Token / Regenerate Token - creates a new token; regenerating invalidates the current one
  • Revoke Token - deletes the token, disabling the webhook
  • One token per script maximum
  • Token is displayed once on generation - store it securely

Rate limiting

Webhooks are rate-limited to 60 requests per minute per webhook. See Limits.

Exceeding the limit returns HTTP 429 (Too Many Requests). Requests beyond the limit are rejected without executing the script.


Context variables

The webhook variable is available in the script:

Property Type Description
webhook.method string HTTP method (GET, POST, PUT, DELETE)
webhook.path string Request path
webhook.headers object Request headers (lowercase keys, first value only, Authorization header removed)
webhook.body object/string/null Parsed JSON body, raw string if not JSON, null if empty
webhook.query object Query parameters (first value only)
webhook.rawBody string Raw request body string

Example

// Log request details
log("Method:", webhook.method)
log("Path:", webhook.path)
log("Query:", JSON.stringify(webhook.query))

// Process JSON body
if (webhook.body && webhook.body.issueKey) {
  const issue = Issues.get(webhook.body.issueKey)
  issue.addComment("Processed via webhook")
  log(`Processed ${issue.key}`)
} else {
  log("No issue key provided")
}

The return value is not the HTTP response body. A successful call always answers {"status": "accepted"} with HTTP 200, whatever the script returns. Use log() for anything you want to inspect afterwards in Run History, and write results to a table or back to Jira rather than to the caller.


HTTP responses

Status Description
200 Request accepted and the script was run - the body is always the static {"status": "accepted"}, never the script’s return value
401 Missing or invalid credentials
403 Web Trigger type disabled, script disabled, or no active license
404 Script not found, or the script has no enabled web trigger
405 HTTP method not allowed
429 Rate limit exceeded, or a scenario started by this script is still running
500 Internal error

Limits

Each webhook run gets up to 50 seconds of execution time, 100 API calls and 50 pending promises. See Limits for all webhook limits.

Scripts run with the actor configured on the script. With Current user there is no user context, so the script runs with application permissions - see Execution Identity.


Notes

  • The Webhook trigger type is disabled by default and must be enabled in Administration before use
  • Both the script and the trigger must be enabled for the webhook to accept requests
  • The script must have a generated token - without a token, the webhook URL exists but returns 401
  • Webhook triggers are singleton - only one per script

See also


JiBrok Studio for Jira Cloud JiBrok Studio for Jira Cloud
Release notes
Core Features
Triggers
Extensions
Data Storage
Scripting Overview
JavaScript Engine
Python Engine
Groovy Engine
Scripting API
Administration
Guides