Script Studio: Workflows

    Script Studio provides a visual workflow editor within the Jira administration area, together with three types of rule that run a script during a transition. Workflows are reached from the Workflows view in the sidebar.

    Note: 📹 Video placeholder — opening a workflow, examining a transition, adding a validator, and linking it to a script.

    1. The Workflows view

    The Workflows view in the sidebar lists the workflows defined on the site, grouped by scope, with the transitions of each workflow shown beneath it.image-20260830-214442.png

    • Workflows are grouped into those shared across projects and those belonging to a single team-managed project.
    • Workflows that cannot be edited are identified as such.
    • A search field is provided for locating a workflow by name.
    • Selecting a workflow opens it in the editor. Selecting a transition opens the workflow with that transition already displayed.

    2. The workflow editor

    A workflow opens as a tab, in the same way as any other document. It has an unsaved-changes indicator, and supports Ctrl+S, undo and redo.image-20260830-214554.png

    The diagram

    Statuses are shown as boxes and transitions as arrows between them, laid out using the positions Jira itself holds, so the diagram matches what the Jira workflow editor displays.

    ActionHow
    Move around the diagramDrag the background, or hold the space bar and drag
    Zoom in or outThe zoom controls in the corner, or the keyboard shortcut shown on them
    Fit the whole workflow in viewThe fit-to-screen control
    Select a status or transitionClick it. The inspector shows its details.
    Move a statusDrag the box
    Create a transitionDrag from the connection point on the edge of a status to another status
    Delete the selectionPress Delete
    Navigate a large workflowUse the overview map in the corner of the diagram
    Show or hide transition names, rule counts and global transitionsThe view controls beside the overview map

    Each transition displays small markers indicating whether it has conditions, validators or post functions, so the rules present on a workflow are visible without opening each transition in turn.

    The toolbar

    OptionPurpose
    SaveSends the workflow to Jira. The workflow is validated before it is saved.
    CheckAsks Jira what it would reject, without saving anything.
    ReloadDiscards the current changes and reads the workflow again.
    Add statusAdds a status to the workflow, either a new one or an existing one.
    Auto-arrangeLays out the statuses automatically and retains the arrangement.
    ProjectsLists the projects that use this workflow.

    Advanced: rules belonging to other applications

    The inspector displays every rule on a transition, including system rules and rules belonging to other applications, marking those as read-only. Jira replaces a transition entirely when a workflow is saved, so displaying all of the rules is what confirms that none of them are lost. Rules belonging to other applications pass through an edit unchanged, identified reliably regardless of which app registered them.

    3. The transition inspector

    Selecting a transition displays its name and description, together with three sections: conditions, validators and post functions. Rules can be added, reordered and removed, and conditions can be arranged into groups where either all of them or any one of them must hold.image-20260830-214630.png

    4. The three types of rule

    RuleRunsPurposeTime limit
    ValidatorBefore the transition completesDetermines whether the transition is permitted4 seconds
    Post functionAfter the transition has completedPerforms follow-up work, with access to the issue, the comment and the change record20 seconds
    ConditionWhen Jira displays the available transitionsDetermines whether the transition is offered to the userImmediate

    What a validator script returns

    The scriptResult
    Returns true, or returns nothingThe transition is allowed
    Returns falseThe transition is blocked, with the rule's own message
    Returns a piece of textThe transition is blocked, and that text is shown to the person clicking the button
    Fails to complete (an error, or a timeout)The transition's failure behaviour applies — blocking, by default

    Validators and post functions

    Each is linked to a script. A rule card provides the following:

    • Link a script, or New from template to create one and link it in a single step.
    • Open script, which opens the linked script in the editor.
    • If the script fails: block the transition, or let it through. Blocking is the default for a validator, on the basis that a check which did not run has not been passed.
    • Recording: record every execution, or record failures only.
    • A test, which runs the rule against an issue of your choosing and displays the result together with the output produced by the script. The test never writes to Jira: any call the script makes other than a read is refused for the duration of the test, whatever the script itself asks for. image-20260830-214704.png

    Conditions

    A condition is written as a Jira expression rather than as a script, because Jira evaluates all conditions at once while displaying an issue and cannot call anything external at that moment.

    The editor provides:

    • Ready-made examples for the most common requirements, which can be inserted with a single click: only the assignee may move the item, every sub-task is complete, the reporter belongs to a group, a field has been filled in, only within one project, not on a particular day.
    • Check, which validates the expression.
    • Try it, which evaluates the expression against a chosen issue and reports the result.

    Using a script to govern a condition

    Where the decision genuinely requires a script, the editor provides a computed gate. The script is set up as a calculated field, which is recalculated when an issue is opened, and the editor writes the expression that reads that field. The condition therefore consults a value the script has already produced, rather than calling the script as the issue is drawn.

    The editor can either use an existing script or create the gate script for you, and then builds the expression automatically.image-20260830-214738.png

    5. Identifying where a script is used

    The Properties panel lists the transitions that use the selected script, together with the workflow and rule type concerned. A script used by a workflow rule is also marked in the file tree.

    6. Choosing between a workflow rule and an event

    UseWhen
    A validatorThe transition must be prevented. No other mechanism can do this, as events occur after the transition has taken place.
    A post functionThe follow-up work must form part of the transition and take place immediately.
    A conditionThe transition should not be offered at all, which is clearer for the user than offering it and refusing it.
    An event triggerThe work is not time critical and should not delay the user's transition.

    7. Troubleshooting

    SymptomAction
    A transition is prevented without explanationA validator has failed, or returned false. The execution is recorded in the run history with the full error or return value.
    A transition is no longer offeredA condition has evaluated to false, or the expression could not be evaluated. Both cases are recorded in the run history.
    A transition responds slowlyA validator is subject to a short time limit. Move any substantial work to a post function or an event trigger.
    The rule has no effectThe rule may have been added without a script being linked. Open it and select one.
    A test appears to do nothingThe script may be trying to write to Jira. Testing only permits reads; switch off the test to run the rule for real.
    Jira rejected the workflow when savingUse Check to see what Jira objects to before attempting to save again.
    The workflow cannot be editedThe Workflows view marks read-only workflows. These are typically in use by projects in a way that prevents modification.

    Related pages