Q:

How to automatically link work items to the build? 

I noticed that work items can be linked to a build.   But I don't see a way to automatically link the work items to the build. 
On pull requests, we require pull requests to be associated with a work item.   When the pull request is complete, the work item is updated with a link to the commits. 
If I look at a branches commit history in TFS, there is a build column.   I assume that the build column would contain the build that the commit is in, but it is always blank. 
We want to be able to look at a build and see what work items are contained in the build. 
Is there a way to do this? 

A:

The “Automatic linking of a build with associated work items” feature was released in TFS 2017 Update 2.  You could enable this feature by toggling the setting under Options in your build definition:

In this way, each successful build associated with the work item automatically appears in the development section of the work item form. 
More information you can refer to the blog below:
https://blogs.msdn.microsoft.com/devops/2017/08/25/automatic-linking-work-items-to-builds/

