query results are not correct after adding a new field for bug  
Author Message
Rachel Wang





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

I added a new field for bug definition and imported to the team project. I set a default value for this field, so all existing bugs use the default value. But when I run a query using this field, the results are incorrect. Only 5 bugs were found, but accutally there should be hundreds of bugs. Then I go through all bugs, and the new field of each bug does have the default value. I am confused. How to resolve this issue

Visual Studio Team System29  
 
 
Smitha S Saligrama





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

Hello Rachel,

If you had used the <Default> rule on the new field it means that "When a user creates a new work item or edits a work items, the <DEFAULT> element will fill in a field value if the field is empty"

So this rule will not work on exisiting work items which are not edited.

Another way of filling this field with a default value for exisiting work items will be either do a bulk edit from Excel Integration or MS Project Integration or Use Work Item Object Model to fill the field.

Thanks,



 
 
Rachel Wang





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

I tried to do a bulk edit from Excel, but the changes did not take effect after I published the changes. Why
 
 
Smitha S Saligrama





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

There can be couple of reasons.

1. For performance reasons we publish work items in excel only when a field value is changed. So a field value must change

2. If you had the new added field in the excel listobject has a column then the default value will be overwritten by excel.

So one way to bulk edit in excel would be to get all the work items. Add the new field as a column. Bulk edit the field to have the default value and publish.



 
 
Rachel Wang





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

I run a query to get all the bugs, and open in excel. The new field has one column. I edit the field to have the default value and then publish the changes. But after publishing, the value in this column disappeared and the the field for all bugs was still empty.
 
 
Smitha S Saligrama





PostPosted: Team Foundation Server - Work Item Tracking, query results are not correct after adding a new field for bug Top

Hello Rachel,

Sorry for facing this issue. I tried the same thing in my box and found out that it a bug we need to fix.

For now do you have any other field which is common among all the Bug work items (Like Iteration Path or Area Path or an empty description).

You can change this field to some value, publish and then edit again to old value and publish.

Or You can use Work Item OM to edit all the work items.

Regards,