Reputation: 82291
I am trying use the new server side plug-in feature for TFS 2010. (I got the basics of how to get started doing this from here and here)
It works great and is many times faster than the normal web service way of handling TFS Events.
But the server side methods are very very undocumented. I have figured out how to retrieve a work item (via Microsoft.TeamFoundation.WorkItemTracking.Server.DataAccessLayerImpl.GetWorkItem
(and GetWorkItemXml
)
But doing an update is confusing me. All the update methods take xml. But the xml you get back from GetWorkItemXml is not the right format (it says that "Action 'FIELD' is not allowed).
I have tried using the Client Side TFS API and it works. But it is slower than I would like because it is wrapping up soap calls back to the server. Since I am already running on the server, it would be nice to not have to have that extra (unneeded) communication step.
Does anyone out there have any server side experience with TFS? Can you give me a pointer on how to make an update to a work item using server side methods?
Upvotes: 1
Views: 1658
Reputation: 8939
Unfortunately, the Server Object Model for Work Item Tracking is not very useful. Unless you want to do some seriously heavy lifting yourself, using the Client Object Model (Microsoft.TeamFoundation.WorkItemTracking.Client.dll) is the best choice.
If you want to work with the Server OM for Work Items, you have to work in XML packages. These are not documented/supported, so YMMV. Here's the "best" documentation that there is on them: http://marshalbyrefobject.blogspot.com/search/label/Work%20Item%20Tracking
And here's a sample of what one looks like:
<Package Product=http://your_server:8080/WorkItemTracking/v1.0/ClientService.asmx DisableNotifications=”True” xmlns=””>
<InsertWorkItem ObjectType=”WorkItem” BypassRules=”True”>
<ComputedColumns>
<ComputedColumn Column=”System.RevisedDate”>
</ComputedColumns>
<Columns>
<Column Column=”System.WorkItemType”>
<Value>Bug</Value>
</Column>
<Column Column=”System.AreaId”>
<Value>40</Value>
</Column>
<Column Column=”System.CreatedBy” Type=”String"/>
</Columns>
<InsertText FieldName=”Microsoft.VSTS.CMMI.Analysis” FieldDisplayName=”Analysis”>text goes here </InsertText>
</InsertWorkItem>
</Package>
Upvotes: 2