Workflow requirements let you reference custom fields and other YouTrack entities that must be available for a workflow rule to work. Before YouTrack runs the rule, it checks each declaration and makes the matching entity available in the workflow context.
YouTrack reports missing requirements on the workflow administration pages and does not run the rule until all requirements are available.
References
Makes each matching entity available under its requirement alias in the context object.
Use aliases such as ctx.Priority.Major, ctx.Assignee, and ctx.QALead instead of repeating names in the rule code.
Requirement Categories
Project-Wide Requirements
Use project-wide requirements to list custom fields that must be attached to every project where the workflow is attached and the rule is active. You can also require specific field values that the rule reads, assigns, or compares.
Use system-wide requirements to list entities that belong to the YouTrack instance rather than a specific project. YouTrack makes each matching entity available in the workflow context.
Require a specific system-wide user, for example by login.
You can read the value of an attached field through ctx.issue.fields without adding the field to requirements. Add the field when YouTrack must check that it exists, when the rule references field values by alias, or when the field prototype must be available through ctx.
In this example, ctx.issue.fields.PeriodField is the value stored in the issue, while ctx.PeriodField is the PeriodProjectCustomField prototype:
All requirement declarations follow the same structure for project-wide fields, field values, and system-wide entities. The type property identifies the field or entity type. Additional properties identify the specific field, value, or entity.
This declaration requires an Assignee field in every project where the workflow is attached and the rule is active.
Each entry in the requirements object has an alias and a set of properties. The type property is required. The available properties depend on the entity type.
Property
Applies to
Description
type
Every requirement
The field type or system entity type. This property is required.
This on-change rule combines project-wide and system-wide requirements. When the issue state changes to a value other than Fixed, the rule sets the priority to Critical and displays a message that names the release owner.