Workflows, Transitions, Conditions, Validators, and Post Functions
Workflow mechanics
A workflow is a set of statuses connected by transitions. Each transition can carry three kinds of logic: conditions (who may execute it), validators (what must be true for it to succeed), and post functions (what happens after it succeeds). Understanding the execution order-condition, then validator, then the transition, then post functions-is essential. Post functions are how Jira sets the resolution, assigns the issue, updates a field, or fires an event.
Conditions include permission checks, group/role membership, and the built-in "only assignee" style checks. Validators include required field checks and custom scripts. Post functions run in order and can be reordered; the order matters when one function depends on another. The workflow scheme maps issue types to workflows, and a single scheme can map many issue types to the same workflow.
Traps to watch
- Confusing a condition (blocks the transition button) with a validator (allows the click but fails the transition with an error).
- Forgetting that a global transition can be triggered from any status.
- Assuming post functions run before the issue is saved; they run as part of the transition and ordering is significant.
- Overlooking that a workflow must be published/drafted appropriately before changes take effect.
Rule of thumb
Ask "should the user even see the button?" → condition. "Should the action be rejected with a message?" → validator. "Should something happen automatically afterward?" → post function.
Worked example: closing an issue must always set resolution. Use a post function that sets the resolution field on the close transition rather than a validator, because the value should be applied, not merely checked.