How to obtain a list of workspaces using Rally REST .NET

前端 未结 1 1338
Happy的楠姐
Happy的楠姐 2021-01-22 15:49

I\'m trying to obtain a list of available workspaces for a given Rally subscription, but it doesn\'t seem like the actual workspaces are being returned in the query.

He

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-22 16:26

    v2.0 removed the ability to return child collections in the same response for performance reasons. Now fetching a collection will return an object with the count and the url from which to get the collection data.

    Example: /subscription/12345/workspaces

    The recently released 2.0 version of the .NET Rest Toolkit supports WSAPI v2.0 and collection querying.

    RallyRestApi restApi = new RallyRestApi("username", "password");
    
    //get the current subscription
    DynamicJsonObject sub = restApi.getSubscription("Workspaces");
    
    //query the Workspaces collection
    QueryResult queryResult = restApi.Query(sub["Workspaces"]); 
    
    foreach (var result in queryResult.Results)
    {
        var workspaceRef = result["_ref"];
        var workspaceName = result["Name"];
    }
    

    0 讨论(0)
提交回复
热议问题