Scriptline / Docs / Listeners

Listeners

Last updated 03/11/2026

Listeners run a script automatically when something happens in Jira. There are ten kinds:

KindFires when
onCreate / onUpdate / onDelete / onAssignA work item is created, updated, deleted, or its assignee changes.
onCommentA comment is added or edited (context.event.comment).
onWorklogA worklog is created, updated or deleted (check context.event.eventType).
onLink / onAttachmentA work item link or attachment is created or deleted.
onVersionA project version is created, updated, released, unreleased, archived or deleted.

Create a listener

  1. Open Listeners in the sidebar and click New listener. The Console opens with an event trigger selected.
  2. Choose the event kind, for example Work item created.
  3. Optionally scope it: pick Projects, Work item types and, for updates, Changed fields.
  4. Write the script. Type a real work-item key in Simulate event for work item key and Dry run to rehearse.
  5. Name it, keep Enable this hook on save on and click Save hook.
  6. Make a matching change in Jira and check Run history.

Scoping

Each listener can be limited with searchable pickers loaded live from your Jira: Projects, Work item types and (for onUpdate) Changed fields. Empty pickers match everything. Filters fail open: if an event doesn't carry enough data to evaluate a filter, the listener still runs, so scoping can never silently stop it.

"Assigned to a Team"? Jira Cloud has no team-assignment event. A team change is an onUpdate whose changes include the Team field, so scope an onUpdate listener to the Team changed field.

Example

// kind = onCreate: comment on every newly created work item
const key = context.event.issue.key;
await jira.addComment(key, 'Thanks! Triage checklist: severity, component, steps.');
return { commented: key };