Scheduled triggers
Run scripts on a recurring schedule. One per script (singleton).
| Interval | Description |
|---|---|
| Every 5 minutes | Runs approximately every 5 minutes |
| Hourly | Runs every hour |
| Daily | Runs once per day |
| Weekly | Runs once per week |
Scripts run with the actor configured on the script.
How it works: The scheduled handler pushes each script into the async queue instead of executing them directly. Each script then runs independently in its own invocation. See Limits for execution time and API call limits.
Note: The
eventvariable is not available in scheduled triggers. Use the Jira REST API or built-in functions to fetch data.
Example
// 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
