Event Triggers

Event triggers

Run scripts in response to Jira events. One per script (singleton). You can select multiple events for one trigger.

Available events (32 total)

Category Events
Issue issue_created, issue_updated, issue_deleted, issue_assigned
Comment comment_created, comment_deleted, comment_mentioned
Worklog worklog_created, worklog_updated, worklog_deleted
Attachment attachment_created, attachment_deleted
Issue Link issuelink_created, issuelink_deleted
Version version_created, version_updated, version_released, version_deleted
Component component_created, component_updated, component_deleted
Project project_created, project_updated, project_deleted
Sprint sprint_created, sprint_started, sprint_updated, sprint_closed, sprint_deleted
Board board_created, board_updated, board_deleted

Individual event types can also be switched off site-wide in Admin Panel -> Admin -> Event Types (see Administration).

Run as

Scripts run as the actor configured on the script (Run as). With Current user, the script runs as the user who caused the event; when the event carries no user, it runs with application permissions. A specific actor configured on the script overrides this. The event variable contains the full event payload (see below).

Limits: 25 seconds execution, 60 API calls per run. See Limits.


Trigger conditions

Event triggers support optional conditions that filter which events actually execute the script. Conditions are evaluated before the script runs - if conditions are not met, the script is skipped.

Condition type Description
Field Changed Execute only when specific fields were changed. Specify one or more fields
Status Transition Execute only when the issue transitions between specific statuses. Specify source and/or target statuses
JQL Condition Execute only when the issue matches a JQL query

Multiple conditions can be combined with AND (all must match) or OR (any must match).

Limit Value
Max conditions per trigger 10
Max fields per Field Changed condition 20
Max source / target statuses per Status Transition condition 20 each
Max JQL length 2,000 characters

Loop prevention

Event triggers include built-in ignoreSelf protection - any Jira events caused by JiBrok Studio scripts are automatically ignored by all event triggers. This prevents infinite loops: a script on issue_updated calling issue.update() does not re-trigger itself or any other event trigger. This is built into the platform - there is no setting to enable or turn off.

What this means in practice:

  • Your script on issue_updated can safely call issue.update() - the resulting event is blocked
  • Your script on issue_created can safely call Issues.create() - the new issue won’t trigger event scripts
  • This applies to all event triggers in the app, not just the current script

Chaining scripts via events: Since ignoreSelf blocks all app-generated events, one event script cannot trigger another event script through Jira events. If you need Script A to trigger Script B after completion, use Async Events with asyncEvent.push(scriptId, payload) instead.


Event variable

The event object contains properties depending on the event type:

Property Type Available for
event.eventType string All events - the event type (e.g. "issue_created")
event.atlassianId string All events - Account ID of the user who triggered the event
event.issue object/undefined Issue, comment, worklog, attachment events
event.changelog object/undefined issue_updated
event.comment object/undefined Comment events
event.worklog object/undefined Worklog events
event.attachment object/undefined Attachment events
event.sprint object/undefined Sprint events (includes id, name, state, boardId)
event.sprint.boardId number/undefined Sprint events - the board ID associated with the sprint
event.board object/undefined Board events
event.version object/undefined Version events
event.component object/undefined Component events
event.project object/undefined Project, version, component events
event.sourceIssueId string/undefined Issue link events
event.destinationIssueId string/undefined Issue link events
event.issueLinkType object/undefined Issue link events
event.associatedUsers array/undefined Events that involve user lists
event.mentionedAccountIds array/undefined comment_mentioned
event.user object/undefined User-related context

Automatic context: When the event contains an issue object, the runtime variables issue and issueKey are set automatically - no need to call getIssue().

Example

// Log field changes on issue_updated
if (event.eventType === "issue_updated" && event.changelog) {
  for (const item of event.changelog.items) {
    log(item.field, ":", item.fromString, "->", item.toString)
  }
}

// Access issue data directly (auto-populated from event)
log("Issue:", issueKey, "-", issue.fields.summary)

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