Work Item Rule In Visual Studio Team Service

Introduction

The work item rule is used to customize the behavior of the work items in Visual Studio Team Services. It’s the simplest way to automate the actions in work items. In this article, I’m going to show you how to create a work item rule in VSTS and how it will work effectively in day to day processes.

Prerequisites

Basic knowledge of Visual Studio Team Service.

If you are new to VSTS, get started from here.

Creating a Rule for Work Item

Step 1

Log into VSTS. It will land you on the project page. Click on the project to experiment with the work item rule.
 
 

Step 2 

Go to Work - > Backlogs to view the work item, as shown in the below figure.

 
 
Right now, I have two work items which have the type as Task.
 
 
Step 3

Double click on the task to view it, click on the button in the top right corner, and select "Customize".
 
 

It will land on "All Processes" page. there, select "Rules".
 
 
Step 4

Let's create a Rule. Click on the "New Rule" button which is shown in the above figure. The rule page will be opened.  

Rule Creation consists of three steps

  1. Name the Rule
  2. Conditions
  3. Actions

Scenario to set a rule

I need to set my activity of the work item to documentation whenever the work item is moved from "New" to "Active" state. This process can be automated using the rule.

  1. Name the Rule
    In my case, I have given the rule name as "Change the Activity", as shown in below figure .
  2. Give a conditions
    When the work item state is changed from new to active.

  3. Actions
    Change the activity status to documentation.


    Once the action is done, click on "Save" to save the rule.
Note

This rule will not be triggered automatically for all the existing work items. It can be applied only by updating the existing work item or creating a work item. 
 
Now, let's open our existing work item task and change the state.
 
Result
 
 
From the above image, you can notice that once the state is changed from New to Active, the "Change the Activity" rule is triggered and the activity is changed to documentation.
 

Let’s create an another rule - when the work item state is changed to removed, it will make a description as required.


Now, let's open another task and change its state to Removed.



So, as per the "Required Description"  rule, once the work item state is changed to Removed, the description field became required. 

Conclusion

We have seen how to create a work item rule in Visual Studio Team Service from this article. The example which I have shared is of the very basic level, we can automate a lot of actions in work items using this customized rule.

I hope you have enjoyed this article. Your valuable feedback, questions, or comments about this article are always welcome.

Up Next
    Ebook Download
    View all
    Learn
    View all