Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Create Area Path with WorkItemClassificationNode

Tags:

azure-devops

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?

like image 814
Thomas Gassmann Avatar asked Jan 15 '16 08:01

Thomas Gassmann


2 Answers

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.

like image 125
Stephan Steiger Avatar answered Oct 16 '22 16:10

Stephan Steiger


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/

like image 33
Ewald Hofman Avatar answered Oct 16 '22 16:10

Ewald Hofman