YouTrack Server
 

State-machine Rules

Last modified: 09 October 2024

A state-machine rule regulates the transitions from one value to another for a custom field.

You can apply a state-machine rule to any enumerated custom field. However, the most common use case for a state-machine rule is to regulate transitions between values for the State field or another custom field that stores a state type.

When a state-machine rule is applied to a project, the options that are shown in the drop-down list for the field are restricted to the transitions that are defined in the state-machine rule for the current state. The action defined for each value in the state-machine rule is displayed in the drop-down list. If the actual value is different from the name assigned to the action, it is shown to the right of the action in parentheses. The following image illustrates how the list of allowed transitions for the State field changes based on the current value.

Statemachine field values

note

Availability

The Workflow Constructor supports state-machine rules for single-value custom fields of the state and enum types only.

When building a state-machine rule in the workflow constructor, you drag state blocks on canvas and define possible transitions between them. All undefined transitions between states are prohibited.

Sample State-machine Rule

Here is a state-machine rule that defines possible transitions between values of the State custom field.

State-machine rule sample

The Open state is set as initial. This means that all new issues will be created in this state.

Here is the list of transitions that this state-machine rule defines:

When this rule is active, you can change the values of the State custom field in issues according to the defined transitions only. If a certain transition from one state value to another is not defined in the rule, you can't move an issue from this state to the target one directly. Undefined state transitions are prohibited on all levels, including updating issues manually, using a command, or any automation.

For details on how to work in the state-machine editor and create state-machine rules, see State Machines.