Alert Engine (Escalation Service) User Guide

The Alert Engine (Escalation Service) in ScriptFabric empowers Jira Administrators to automate recurring batch operations across work items matching targeted JQL queries.


Core Capabilities

  • JQL Query Filtering: Select target work items using standard Jira Query Language (e.g., project = DEMO AND status = "In Progress" AND updated <= -7d).
  • Batch Processing Engine: Automatically iterate over matching issues and execute your custom JavaScript or TypeScript logic for each item.
  • Flexible Schedule Types: Choose between Interval, Weekly, Monthly, or Cron / Advanced schedule expressions.
  • Timezone Aware: Configure schedule execution in UTC or localized timezones.
  • Execution Modes: Run as App User (elevated system permissions) or Current User (caller scope).
  • Dry Run & Match Preview: Test JQL expressions and preview matched issues before enabling active schedules.

Schedule Frequencies & Cron Syntax

Schedule Type Configuration Example / Syntax
Interval Repeat every N minutes / hours Every 15 minutes, Every 2 hours
Weekly Run on specific days of the week at a set time Mondays & Thursdays at 09:00 AM
Monthly Run on specific days of the month 1st day of the month, 15th day of the month
Cron / Advanced Standard 5-part cron syntax with business day flags 0 9 * * 1-5 (Mon-Fri 9:00 AM)
0 18 L * ? (Last day of month at 6:00 PM)
0 8 1W * ? (Nearest weekday to 1st of month)

Cron Quick Presets

  • 0 0 * * * — Every night at midnight
  • 0 9 * * 1-5 — Mon-Fri at 9:00 AM
  • 0 12 1 * * — 1st of every month at 12:00 PM
  • 0 18 L * ? — Last day of the month at 6:00 PM

Creating an Alert Engine Rule

  1. Open Apps → ScriptFabric in Jira Cloud.
  2. Select Alert Engine from the sidebar menu.
  3. Click Create Rule.
  4. Configure rule parameters:
    • Rule Name: A unique descriptive title.
    • JQL Query: Specify the issue filter query.
    • Schedule Type: Select Interval, Weekly, Monthly, or Cron / Advanced.
    • Run As: Select App User or Current User.
  5. Enter your automation script in the Monaco code editor.
  6. Click Save & Enable.

Injected Script Context

Inside an Escalation script, ScriptFabric injects:

  • issue: Target work item object (key, summary, status, assignee, etc.).
  • logger: Logging utility (logger.info(), logger.warn(), logger.error()).
  • WorkItems: Canarys HAPI for work item updates (WorkItems.transition(), WorkItems.addComment()).
  • getVariable(key): Access encrypted Script Variables.
// Example: Auto-close inactive issues with a reminder comment
if (issue.assignee) {
  await WorkItems.addComment(issue.key, `Hi @${issue.assignee.displayName}, this issue is flagged for inactivity.`);
  logger.info(`Notified assignee for ${issue.key}`);
}