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.
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:
- 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
- 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”
- 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">
<FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" syncnamechanges="true" reportable="dimension" >
- 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