Search code examples
tfstfs-sdk

Where does the work item iterationId field come from?


in the tfs database Tfs_DefaultCollection

There are nearly no keys. (maybe none, as I haven't exhaustively searched)

I'm able to see all my work items, and current/previous states just fine. However when I join WorkItemAre to Tbl_Iteration none of the IterationIds match at all. How do I look at work items by iteration name/title?

my search code is as follows:

    this.Tbl_TeamConfigurationIterations.Dump();
    this.Tbl_Iterations.Dump();
    var myPersonId= foo; // omitted from sample
    var qIteration = from wia in WorkItemsAres.Where(x=>x.AssignedTo==myPersonId && x.State!="Closed" && x.State!="Resolved")
                    join iLeft in Tbl_Iterations on wia.IterationID equals iLeft.SequenceId into iL
                    from iteration in iL.DefaultIfEmpty()
                    select new {iteration.Iteration,wia};
    qIteration.Dump();//.Select(x=>new{x.AreaID,x.IterationID, x.Title,x.WorkItemType}).Dump();

for those interested in the solutions (both direct db and tfs api dll calls):

Direct Db version

Proper Tfs dll calls


Solution

  • @Maslow, you can use xxTree table to get iteration name (join with WorkItemsAre table on IterationID = xxTree.Id) but you should be aware that this is undocumented and unsupported way. I would strongly recommend using TFS object model to do such things.