Stop bad transitions before they happen. Run a script every time an issue is about to transition - block invalid moves, enforce policy, and return a custom error message to the user, all from a Forge-native runtime inside Atlassian's cloud.
Built-in Jira workflow validators cover the basics - "field is set", "user is in role" - but they cannot express anything that depends on dynamic data: cross-issue checks, computed thresholds, lookups in your own tables, or policy that changes by project and customer.
A workflow validator script runs before the transition is applied. If your script blocks the transition, the issue stays in its current status and the user sees the error message your script returned. If it allows the transition, the issue moves and any post-functions run.
This is one of the most common reasons teams adopt scripting on Jira. For years, the workhorse pattern lived inside legacy Connect-based scripting apps. With Atlassian Connect reaching full end of support on 31 January 2027, those validators have to move to a Forge-native runtime - and that move is also an opportunity to remove an external vendor backend from the trust boundary.
An issue cannot transition to Done while any of its subtasks are still open. Return a precise message naming the offending subtask keys.
Transitions of "Change Request" issues to Approved require a CAB approval field to be populated when the impact field is "High" or "Critical".
An Engineering story cannot move to Ready for release until every linked QA ticket is resolved - even across projects.
issue - the issue being transitioned, auto-loadedevent.transition - source and target statusevent.modifiedFields - fields changed in the same transitioncurrentUser - who initiated the transitionBlock or allow based on any of them, with a custom error message returned to the user.
All three live in the same Script Library, share the same Scripting API, and run on the same Forge runtime.
Workflow Validators are available in company-managed projects.
Block Done if any subtask is still open.
// Workflow Validator: 'issue' is auto-loaded by the platform
const subtasks = issue.fields.subtasks || [];
const open = [];
for (const sub of subtasks) {
const child = Issues.get(sub.key,
{ fields: ['status'] });
if (child.fields.status.statusCategory.key !== 'done') {
open.push(child.key);
}
}
if (open.length > 0) {
// Blocking is done by the return value, never by throwing:
// a script error is treated as "allow" (fail-open)
return {
valid: false,
errorMessage: 'Cannot mark Done while these subtasks are open: '
+ open.join(', ')
};
}
return { valid: true };Attach the script to a Workflow Validator trigger, then add the Run Script - JiBrok Studio validator to the target transition. The errorMessage you return is shown to the user when the transition is blocked.
Validators are fail-open by design: if the script itself fails - runtime error, timeout, or an inactive license - the transition is allowed, so a broken script never freezes a workflow. Always block explicitly with return { valid: false }; never rely on throw.
JiBrok Studio's validators run on Atlassian Forge - no vendor server in the path, no third-party data egress.