I'm using the VSTS .NET client libraries and I'm trying to create an area path. I already have a WorkItemTrackingHttpClient
. On this client I can create an area path with the CreateOrUpdateClassificationNodeAsync
Method. But I can't set the parent of the area path.
var node = new WorkItemClassificationNode();
node.StructureType = TreeNodeStructureType.Area;
node.Name = "Test";
var result = await this.Client.CreateOrUpdateClassificationNodeAsync(node, "Team-Project", TreeStructureGroup.Areas);
How can I set the parent of the area path?
You almost got it right. To create a area at a certain path, use the following code:
var node = new WorkItemClassificationNode();
node.StructureType = TreeNodeStructureType.Area;
node.Name = “Name”;
var result = this.Client.CreateOrUpdateClassificationNodeAsync(
node,
"Project",
TreeStructureGroup.Areas,
"Path/to/parent/node/");
The important parameter is the path specifying the parent of the new node.
Shai has a create set of articles on the TFS SDK. This article shows how you can interact with classification nodes: http://blogs.microsoft.co.il/shair/2009/01/30/tfs-api-part-10-add-areaiteration-programmatically/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With