Scriptline / Docs / The Console

The Console

Last updated 03/11/2026

The Console is where every hook is written, tried and saved. It is laid out as four steps:

  1. When should it run? Pick the trigger. Event triggers show scoping pickers, schedules show the visual schedule builder, and the JQL kind explains that the hook's name becomes its search.
  2. What should it do? Write the script, start from one of eleven examples (filtered to your chosen trigger), or paste a JQL and generate a commented script around it.
  3. Try it. Click Run, with Dry run, Run as and event simulation available.
  4. Save it. Name it and choose whether it goes live immediately.

Run a script

  1. Open Console in the Scriptline sidebar.
  2. Type or paste your script in the editor. Top-level await and return work.
  3. Optionally turn on Dry run or switch Run as to me.
  4. Click Run. The result panel shows the status, duration, the returned value and every log line. Errors point at the line in your script.

What a script receives

Exactly three values: jira (the API below), console (captured logging) and context (the event, schedule or work item for triggered hooks). Scripts cannot import packages or reach anything outside this surface.

The jira.* API

MethodDescription
jira.myself()Current profile.
jira.getIssue(key, fields?)Fetch one work item.
jira.search(jql, maxResults?)JQL search (must be bounded, see Limits).
jira.addComment(key, text)Plain-text comment.
jira.updateIssue(key, fields)Update fields.
jira.transition(key, transitionId)Workflow transition by id.
jira.forEachIssue(jql, fn)Page through results and call fn per work item (5,000 cap in one run; use a bulk job for more).
jira.request(method, path, body?)Escape hatch to any Jira REST endpoint.

Dry run, Run as and event simulation

  • Dry run suppresses every write (comments, updates, transitions and mutating jira.request calls) and logs what would have been sent, while reads run for real. Runs are badged DRY RUN.
  • Run as: me runs a console script with your own Jira permissions instead of the app's. Saved hooks always run as the app.
  • Simulate event: type a work-item key, so context.event.issue.key is populated as it would be for a real event.