How to make a field ReadOnly in Azure DevOps for all the states

Though Azure DevOps provides rules to make a field ReadOnly for a particular state in a workitem. There are some workarounds available which you can make use of make a field ReadOnly for all the states (This might basically involve an PowerAutomate in the backend which can update the ReadOnly field).But let us see now how to make a field ReadOnly for all Azure DevOps states.

Let us say we have a field called “Build ID” in a userstory which needs to be readonly for all the states including “New”

To make the field ReadOnly for all the states, you may need to add some rules to the process template for that particular field. Let us see what are the steps below to do that

Step 1: Go to Organization Settings and then click on Process

Step 2: Click on the Process template to which this project belongs

Step 3: Click on the WorkItem Type where you want to add the rule (In this case it’s UserStory)

Step 4: I am going to create 2 rules as shown below

Step 5: The 1st rule is to make the Build ID ReadOnly when the state is “New” and 2nd rule is to make the Build ID ReadOnly when the workitem state is not “New”

Both the above rules will ensure that Build ID is readonly for any state in the UserStory.But now you may ask me how to update this field when it’s readonly? This is where you can make use of API calls or PowerAutomate flow to update the fields via Azure DevOps REST API call as shown over here

You may also like...