Scheduled triggers
Run scripts on a recurring schedule. One per script (singleton).
Interval (select one or more):
| Interval | Description |
|---|---|
| Every 5 minutes | Runs approximately every 5 minutes |
| Hourly | Runs approximately every hour |
| Daily | Runs approximately once per day |
| Weekly | Runs approximately once per week |
How it works: The scheduler does not run scripts itself - it queues each due script, and each script then runs independently in its own background invocation with up to 55 seconds of execution time and 100 API calls. See Limits for the full set of limits.
Run as
A schedule has no current user. Scripts run with the actor configured on the script; a script set to Run as: Current user therefore runs with application permissions. Choose a specific user as the actor if the script needs that user’s permissions.
Event variable
The event variable contains trigger metadata (in per-issue mode it also carries event.issueKey). To work with Jira data in a plain scheduled run, query it with the Jira REST API or built-in functions.
Run once per issue (JQL)
By default a scheduled trigger fires the script once per tick. Fill in the optional JQL (optional) field and it instead fires once for every issue the query returns, so you do not have to write pagination in the script itself. Use it when the work is naturally per-issue; use a plain scheduled run when the job is a single sweep, a report, or a summary.
In per-issue mode the issue is available exactly as it is for event triggers:
| Binding | Description |
|---|---|
issue |
The issue object (issue.key, issue.summary, field access, issue.update(), …) |
context.issue |
Raw issue JSON as returned by the Jira REST API |
issueKey |
The issue key, e.g. "PROJ-123" |
event.issueKey |
Same key, on the trigger metadata object |
// Scheduled hourly, JQL: project = SUP AND status = "Waiting for support"
if (issue.fields.duedate && issue.fields.duedate < Date.currentDate()) {
Jira.addComment(issueKey, "This request is past its due date.")
}
Paging. Issues are processed in pages of up to 50, and at most 4 pages (200 issues) per tick. Anything left over is picked up on the following tick, so a large result set is drained across several runs rather than blowing the platform’s 25-second scheduler budget. Each issue still gets its own async invocation with the full per-trigger execution limits.
Sort order. The run always uses ORDER BY updated ASC, which the paging cursor depends on. If you write your own ORDER BY at the end of the JQL it is replaced.
Overlapping ticks. A trigger scheduled on several intervals is driven by several schedulers, and on the hour (or at midnight) they fire together. Only one tick walks the trigger at a time - the other stands down and leaves the result set to the pass already in progress, rather than processing the same issues a second time.
Scenarios. A JQL takes precedence over scenario detection: a scheduled trigger with a JQL runs the script per issue and does not start a scenario, even if the script uses step().
Skipped ticks. Paging position is kept in the app’s storage, and a tick that cannot reach it stands down whole rather than restarting the result set from page one - restarting is the one outcome that would process the same issues twice. When that happens the trigger shows a Tick skipped badge in Config -> Triggers, naming storage as the reason and the time it happened. Nothing is lost: the next tick picks the pass up where it stopped, and the delta watermark is left untouched. If the badge is still there several intervals later, the schedule is genuinely stalled and worth raising with support.
Only updated issues
Tick Only updated issues since last run and the run JQL is extended with updated >= <last run>, so each pass only walks issues touched since the previous one. On a large project this is the difference between re-reading every issue every five minutes and reading only what changed - it is the main reason the option exists.
The watermark advances only after a complete pass over the whole result set. A run that is cut short by the page budget, or that fails partway, leaves it where it was. Nothing is silently skipped; the cost is that work can be repeated.
Write idempotent scripts. Per-issue delivery is at-least-once, and the same issue can legitimately be processed more than once:
- The
updated >=bound is inclusive, so an issue updated exactly at the watermark shows up in both passes. - If a tick dies partway through a page, that page is replayed on the next tick.
- Editing the trigger’s JQL abandons the in-flight pass and starts a fresh one.
Guard side effects accordingly - check before you comment, use if before you transition, and prefer “set field to X” over “increment field”.
Timezone caveat. The delta bound is written as a plain
"yyyy-MM-dd HH:mm:ss"timestamp spelled out in UTC. Jira interprets a bare timestamp in the instance timezone, so the same text means a different instant on a non-UTC site. On a site behind UTC (the Americas, UTC-5 and friends) the bound resolves to a moment later than the real watermark: issues updated in that gap fall outside the query, are never processed, and the watermark still advances past them - that work is lost. On a site ahead of UTC (UTC+2, UTC+5:30, …) the bound resolves earlier than the watermark, so the window is wider than needed and some issues are processed twice - nothing is lost. If your site is not on UTC, either widen your JQL or leave Only updated issues off.
Example: single sweep
// Daily cleanup: close stale issues with no updates in 30 days
const jql = 'status = "Waiting for Customer" AND updated <= -30d'
const results = Issues.search(jql, { fields: ["status"] })
for (const issue of results.issues) {
issue.transition("Close")
log("Closed:", issue.key)
}
return results.issues.length + " issues closed"
See also
- Triggers Overview - All trigger types at a glance
- Event Triggers - React to Jira events
- Async Events - Trigger scripts asynchronously
