Reputation: 115
I have some questions about the new tfs rest api :-)
first question: The new TFS Rest API interface is really nice, but how can I parse the JSON Object (e.g. /builds/ list) to a valid C# Object? Is there a Object in the Microsoft references, which I can use or do i have to string of Json?
second question: I need the associated work items of the current TFS build (by Build ID?), it was easy to do it in the old TFS C# API. Is it possible for the new rest api as well?
Upvotes: 1
Views: 485
Reputation: 31013
You could install this Nuget package for your project and in the package. The assemblies in this package has already help you transfer the json data to the corresponding object. Check this case: What object returns from TFS2015 RestAPI
Yes. You can get the associated work items of the current TFS build with REST API: https://www.visualstudio.com/en-us/docs/integrate/api/build/builds#work-items
The REST API is as below:
POST https://{instance}/DefaultCollection/{project}/_apis/build/builds/{buildId}/workitems?api-version={version}
Upvotes: 2