Stateless Rule — a simple rule which defines an action to be performed upon a change made for an issue, depending on a condition.
When this sample rule is active, then upon a change in an issue:
- YouTrack checks whether the Subsystem field is changed
- If a Subsystem value is changed, the issue should be automatically assigned to the Subsystem's owner.
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.
This sample 'State's lifecycle' state-machine rule defines the following transitions for the issue's 'State' field:
- Initial state is Submitted
- 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.
- 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.
- 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.
- From 'Duplicate' and "Can't Reproduce' states the issue can be only transited to the 'Reopened' state (upon action 'Reopen')
- From the 'Reopened', the state's value can only transit to the 'Fixed' state upon event (action) Fix.
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 — a rule to define scheduled events depending on a condition. For example, periodically check for issues with certain attribute values and notify a user.
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>"