Code Review default queries not fetching data after upgrading to TFS 2015

We recently noticed that code review default queries are not fetching and displaying the data in team explorer. This behavior is noticed only for the reviewer’s login with the code review default query for the team project, which are upgraded from TFs 2013 version to TFS 2015.

01

We tried a new work item query to fetch the code review items from reviewer login and noticed that work item query is not working when the WI query has the filter criteria Reviewed By = @Me.

To resolve this issue, please follow the steps below:

  1. Performed the witadmin changefield command to set the SyncNameChanges value true for the collection.

witadmin.exe changefield /collection:collectionurl /n:"Microsoft.VSTS.Common.ReviewedBy" /syncnamechanges:true

  1. Export the Code Response work item template from the team project

witadmin.exe exportwitd /collection:collectionurl /p:projectname /f:workitem file path /n:”Code Review Response”

  1. Replace the field definition in the work item from VSTS.Common.ReviewedBy and Microsoft.VSTS.Common.ClosedBy with the line below

<FIELD name="Reviewed By" refname="Microsoft.VSTS.Common.ReviewedBy" type="String" syncnamechanges="true">

<ALLOWEXISTINGVALUE />

<VALIDUSER />

</FIELD>

<FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" syncnamechanges="true" reportable="dimension" >

<ALLOWEXISTINGVALUE />

<VALIDUSER />

</FIELD>

  1. Import the Code Review Response work item back to the team project

witadmin.exe importwitd /collection:collectionurl /p:projectname /f:workitem file path

The above changes will make sure the default query for code review work item is working and displayed in the team explorer section for reviewer.

Hope this information helps resolve the issue.

Content created by: Sinjith Haridasan Reeja
Content reviewed by: Chandra Sekhar Viswanadha