Workflow Rules

Workflow Rules let you inject custom logic into Jira workflow transitions. You can block transitions with Conditions, validate data with Validators, and perform automated actions with Post Functions - all using JavaScript.

The Three Types

Type When It Runs What It Does If It Fails
Condition Before showing the transition button Determines if the user can see/use a transition Button is hidden (fail-open: if script errors, button shows)
Validator After user clicks transition, before it completes Validates that required data is present/correct Transition is blocked with error message (fail-closed: if script errors, transition blocks)
Post Function After transition completes successfully Performs automated actions Issue has already transitioned; error is logged but doesn't roll back

How to Add Workflow Rules

  1. Go to Project Settings → Workflows and edit the relevant workflow
  2. Select a transition (e.g., "Start Progress", "Resolve", "Close")
  3. In the transition properties, add a ScriptForge extension:
    • Add a Condition to control who sees the button
    • Add a Validator to enforce data requirements
    • Add a Post Function to automate follow-up actions

ScriptForge workflow rules appear as Forge-powered rules in the workflow editor.

Execution Context

All workflow rule scripts receive context about:

  • The issue being transitioned
  • The user performing the transition
  • The transition being executed (from/to status)

Fail Behaviour

  • Conditions fail-open: If your condition script throws an error, the transition button is shown anyway. This prevents broken scripts from permanently blocking workflow progress.
  • Validators fail-closed: If your validator script throws an error, the transition is blocked. This ensures data integrity - if the validator can't verify data, it's safer to block.
  • Post Functions log errors: If a post function fails, the transition has already happened. The error is recorded in the activity log but doesn't affect the issue's state.