Developer Portal for YouTrack and Hub
 

State-machine Rules

Last modified: 7 November 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. Custom fields that are regulated by a state-machine rule are marked with a Workflow-driven field icon. The action that is defined for each value in the state-machine rule is displayed in the drop-down list. The actual values are shown to the right. The following image illustrates how the list of allowed transitions for the State field changes based on the current value.

Statemachine field values

YouTrack provides templates for two types of state-machine rules.

  • A basic state-machine rule that regulates the transitions from one value to another for a custom field. To learn more about this type of state-machine rules, see Basic State-machine Rules.

  • A state-machine rule that imposes separate sets of state transitions based on the current value in a specified field. To learn how to script this type of state-machine rules, see State-machine Rules per Issue Type.

    note

    Availability

    The ability to create and edit state-machine rules per issue type is only supported by the JavaScript Editor. This feature is not available for the Workflow Constructor.

Both of these state-machine rule types are built using a similar collection of parameters.