Add a rule to a work item type (Inheritance process)

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Custom rules provide support for a number of business use cases, allowing you to go beyond setting a default value for a field or make it required. Rules allow you to clear the value of a field, copy a value into a field, and apply values based on dependencies between different fields' values.

Important

This article applies to Azure DevOps Services and Azure DevOps Server 2019 and later versions. To customize any project defined on a collection for TFS 2018 or earlier, see On-premises XML process model.

Important

You can only use the Inheritance process model for projects defined on a project collection configured to support the Inheritance process model. If your on-premises collection is configured to use the On-premises XML process model, you can only use that process model to customize the work tracking experience. To learn more, see Customize work tracking, Choose the process model for your project collection.

To customize any project defined on a collection for TFS 2018 or earlier, see On-premises XML process model.

With a custom rule, you can define a number of actions based on specific conditions. For example, you can apply a rule to support these types of scenarios:

  • When a value is defined for Priority, then make Risk a required field
  • When a change is made to the value of Release, then clear the value of "Milestone"
  • When a change was made to the value of Remaining Work, then make Completed Work a required field
  • When the value of Approved is True, then make Approved By a required field
  • When a user story is created, make the following fields required: Priority, Risk, and Effort
  • When current user is a member of "Project Administrators", then make Priority required
  • When current user is not a member of "Project Administrators", then hide the Priority field

Note

You make a field required and specify a field default through the Options tab for the field.

Prior to defining a custom rule, review Rules and rule evaluation, Inherited process rule composition. For examples that illustrate common scenarios for applying rules, see Sample rule scenarios.

Prerequisites

Prior to customizing a process, we recommend that you review Configure and customize Azure Boards, which provides guidance on how to customize Azure Boards to meet your business needs. For a description of the different backlogs and boards, see Tasks supported by Backlogs, Boards, Taskboards, and Plans.

Open Settings>Process

You create, manage, and make customizations to processes from Organization settings>Process.

  1. Choose the Azure DevOps logo to open Projects. Then choose Organization settings.

    Open Projects>Organization settings.

  2. Then, choose Process.

    Then, choose Process.

    Important

    If you don't see Process, then you're working from TFS-2018 or earlier version. The Process page isn't supported. You must use the features supported for the On-premises XML process model.

You create, manage, and make customizations to processes from Collection Settings>Process.

  1. Choose the Azure DevOps logo to open Projects. Choose the project collection whose processes you want to customize, and then choose Collection Settings.

    Open Projects>Organization settings

  2. Then, choose Process.

    Then, choose Process.

You create, manage, and make customizations to processes from Admin settings>Process.

  1. Choose the Azure DevOps logo to open Projects. Then choose Admin settings.

    Open Project>Organization settings.

  2. Then, choose Process.

    Then, choose Process.

Note

As you customize an inherited process, all projects that use that process are updated automatically to reflect the customizations. For this reason, we recommend that you create a test process and test project when you have a number of customizations to make in order to test the customizations prior to rolling them out to your organization. To learn more, see Create and manage inherited processes.

Add a custom rule

You add fields to a selected work item type.

  1. Select the WIT to which you want to add a rule, choose Rules, and then choose New rule.

    Process, WIT, Bug, Layout, New rule

    If you can't fill out the New work item rule dialog, you don't have the necessary permissions to edit the process. See Set permissions and access for work tracking, Customize an inherited process.

  2. Name the rule and select the condition(s) and action(s) from the dropdown menus.

    Tip

    Specify a name that builds off the field(s) you're acting on, or the conditions you're setting.

    Here we define that the Acceptance Criteria field is required when the State changes to Active and it is currently empty.

    New rule form

    The sequence of actions you specify doesn't impact the behavior of the rule itself or its behavior with respect to other rules defined for the same WIT.

  3. Once you've added a custom rule, open a work item and verify that the rule works as you intended.

Delete or disable a rule

You can temporarily disable a rule or delete it altogether.

You delete or disable the rule from the actions menu of the rule.

Delete or disable a rule

Note

You can review changes made to an inherited process through the audit log. To learn more, see Access, export, and filter audit logs.