How to define custom rules for Work Items in Azure DevOps

How to define custom rules for Work Items in Azure DevOps

We can define custom rules for work items in Azure DevOps that support several business validations and use cases. For any Azure DevOps Project, We choose project templates such as Agile, Scrum, Basic, or any other custom template during the creation of the Azure DevOps Project. Each Project template type has it own work item types or even we can add our own custom type.

Custom rules for Work Items in Azure DevOps

Custom rules for work items can be applicable for a single field or group of failed; which may result in a business validation.

For instance, let us try to implement this if the value of some filed in work items is set to true, the justification has to be mandatory.

Adding Custom Field

Add Two Custom Fields – Validation Required ( Boolean ) and Justification for Validation ( Multiline TextBox) for custom work items called Activity.

Set the Rules

Once the Fileds are created, Move to the Rules Tabs and Click on the New rule button.

The New Rule setup window will bring a configurator where you can configure the Condition and corresponding action for the condition.

The rules set is now applied, and now let’s go back to the work items and see if the rule is working or not.

Creating the new “Activity” Work Item

From the Project Board, create a new work item type Activity.

You should be able to see both the custom field “Validation Required” and Justification for Validation under the Validation Section.

Now as the default value of Validation Required is set to false, the Justification of Validation is now not required.

As soon as we mark the “Validation Required” as true, Justification of Validation will turn into a required filed.

The validation rules for work items are very helpful and very easy to configure. This can let control lot of business validation throughout the lifecycle of development in Azure DevOps.

Not only for custom Work Item types, but you can also create custom rules for existing work item types as well.

Hope this was useful.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.