質問

I have a board with customized columns in my backlog. Is there any way to get all user stories in a specific column?

I have two columns with same state 'active', so I cannot filter by state, I need to do it by column name. For instance, I need to get 'user stories' in column 'A' (status Active) without return the 'user stories' in column 'B' (also Active).

Update: The program does not run on the same computer TFS is installed. I need to do this in client side.

public class Program
{
    static void Main(string[] args)
    {
        Uri collectionUri = new Uri("http://tfs-server/tfs");

        TfsConfigurationServer configurationServer =
            TfsConfigurationServerFactory.GetConfigurationServer(collectionUri);

        ReadOnlyCollection<CatalogNode> collectionNodes = configurationServer.CatalogNode.QueryChildren(
            new[] { CatalogResourceTypes.ProjectCollection },
            false,
            CatalogQueryOptions.None);

        Guid collectionId = new Guid(collectionNodes[0].Resource.Properties["InstanceId"]);
        TfsTeamProjectCollection teamProjectCollection = configurationServer.GetTeamProjectCollection(collectionId);

        var workStore = teamProjectCollection.GetService<WorkItemStore>();

        var storiesInA = workStore.Query(
                       @" Select [State], [Title] From WorkItems
                        Where
                            [Work Item Type] = 'User Story' and
                            [State] = 'Active' and
                            [System.AreaPath] = 'MyPath'
                        Order By [State] Asc, [Changed Date] Desc");
    }
}
役に立ちましたか?

解決

Kanban columns are specific to a Team and need to be accessed through a team specific context. You can access this through the WorkItemTypeExtensionService in TFS. You can find the answer here:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top