You are viewing documentation for the older version of YouTrack!
Skip to end of metadata
Go to start of metadata

Sample Workflow Rules

Stateless Rule

Stateless Rule — a simple rule which defines an action to be performed upon a change made for an issue, depending on a condition.

Stateless Rule Sample

When this sample rule is active, then upon a change in an issue:

  1. YouTrack checks whether the Subsystem field is changed
  2. If a Subsystem value is changed, the issue should be automatically assigned to the Subsystem's owner.
Click to expand and view the sample Stateless rule

The sample stateless rule in the Workflow Editor:

State-machine Rule

State-machine Rule — a rule to define transitions between some states of an issue. A state here is not only a 'State' field of an issue, but any field of an issue which can have a defined transitions from one value to another. However, the most obvious and most often used state-machine rule is about transitions between values of the State field.

State-machine Rule Sample

This sample 'State's lifecycle' state-machine rule defines the following transitions for the issue's 'State' field:

  1. Initial state is Submitted
  2. From initial state issue can be transmitted to the following states only:
    • On event (action) Open the state's value should be set (should transit) to 'Open' state.
  3. From the 'Open' state only the following transitions are allowed:
    • On event (action) Fix the state's value should be set (should transit) to 'Fixed' state.
    • On event (action) Duplicate the state's value should be set (should transit) to 'Duplicate' state.
    • On event (action) Can't reproduce the state's value should be set (should transit) to 'Can't Reproduce' state.
  4. From the 'Fixed' state only the following transitions are allowed:
    • On event (action) Verify the state's value should be set (should transit) to 'Verified' state.
    • On event (action) Reopen the state's value should be set (should transit) to 'Reopened' state.
    • In addition, when the issue is set to Fixed state (on enter to the 'Fixed' state), the Subsystem field should be changed to "Testing".
      Please note, that, if the above shown stateless rule sample is active in the same target project, then the issue should be re-assigned to the owner of 'Testing' subsystem.
  5. From 'Duplicate' and "Can't Reproduce' states the issue can be only transited to the 'Reopened' state (upon action 'Reopen')
  6. From the 'Reopened', the state's value can only transit to the 'Fixed' state upon event (action) Fix.
Click to expand and view the sample Statemachine rule

The sample statemachine rule in the Workflow Editor:

When a statemachine rule is applied to a project, then the field 'State' will be visually marked as 'workflow-driven field' with statemachine rule icon and in the drop-down list only allowed actions will be available:

Scheduled Rule

Scheduled Rule — a rule to define scheduled events depending on a condition. For example, periodically check for issues with certain attribute values and notify a user.

Scheduled Rule Sample

Presented here 'Check for Due date and notify assignee' sample scheduled rule defines the following periodic action:

  • Each day, at 8 AM sharp, YouTrack should check issues with a 'Due date' field, and if the Due date should expire in less (or exactly) the 2 days, then send a notification to the issue's assignee in the following format:
    • Notification subject: "The Due date of the issue is less then 2 days"
    • Notification text: "The Due date is less then 2 days for the issue <issueID>"
Click here to expand and view the sample Scheduled rule

The sample scheduled rule in the Workflow Editor:

Labels:
workflow workflow Delete
rule rule Delete
sample sample Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.