Hi Grant, Thanks for your reply.
For some reason my email took forever to get to Oz TFS (probably something on my end) - so I ended up coming up with something similar to what you've mentioned here. I ended up querying the database, looking in the "workitemsare" and "workitemswere" table for the "bad" update, queried the "workitemswere" table for the last "correct" record, grabbed the affected columns from there and pasted the correct into a linked excel worksheet - publishing the values. Luckily, the only fields that needed to be changed were title, allocated to and status and a few custom fields so it wasn't anything hairy. Thanks for your time though on answering my query, I didn't even think about using .Net to query against the API - doh! Cheers Matt. From: Grant Holliday [mailto:[EMAIL PROTECTED] Sent: Thursday, 28 August 2008 12:23 AM To: [email protected] Subject: [OzTFS] RE: Rollback work items easily You could write some code that retrieves each work item (via a query), then retrieves the previous 'revision' of a work item, updates the work item with the previous values and saves the new revision. To get the previous revision you could do it two ways: * Get the latest, then get the current revision - 1. WorkItem workItem7 = workItemStore.GetWorkItem(id, <revision number>); * Get the work item "as of" the date the change was made: WorkItem workItem5 = workItemStore.GetWorkItem(id, new DateTime(2006, 4, 17)); Also, if the changed fields are "reportable" fields, then each revision also makes it into the warehouse. You can use the [Work Item] table in database TfsWarehouse. Each revision of every work item is stored in this table. The System_Id column is for work item id, and Work Item column is derived from work item id and revision number. For more information about this table, see Dimension Table for Work Items.<http://msdn.microsoft.com/en-us/library/ms244668.aspx#WorkItem> Grant From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Hunter Sent: Tuesday, August 26, 2008 8:39 PM To: [email protected] Subject: [OzTFS] Rollback work items easily Hi Guys, Little bit of an emergency :) A staff member has managed to update all our work items using excel with the wrong value (via a paste from a totally different worksheet & then a publish I guess) which updated every single field in most work items to the wrong value. Apart from rolling back the database, it there another way to roll back to the previous change? Cheers Matthew Hunter ________________________________ [cid:[email protected]] Matthew Hunter Senior Developer Stargate Group Level 3, 600 Victoria Street Richmond Victoria 3121 Telephone: 03 8420 3000 Facsimile: [cid:[email protected]]<http://www.stargategroup.com.au/> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. No responsibility is assumed by the company or its employee to any other person for any loss or damage (whether caused by negligence or not) arising from the use of the information and advice contained herein. Finally, it is your responsibility to check any attachments for viruses and defects before opening or sending them on. ________________________________ OzTFS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. View the web archives at http://www.mail-archive.com/[email protected]/ Powered by mailenable.com, supported by www.readify.net OzTFS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. View the web archives at http://www.mail-archive.com/[email protected]/ Powered by mailenable.com, supported by www.readify.net OzTFS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. View the web archives at http://www.mail-archive.com/[email protected]/ Powered by mailenable.com, supported by www.readify.net
<<inline: image001.gif>>
<<inline: image002.jpg>>
