Confusion about WorkitemIds RRS feed

  • Question

  • I have a question on WorKItemId's. I have a little winform app and I'm using wiql to get a WorkItemCollection.

    string strTFSCollection = GetConfigSetting(ConfigSectionName, "TFSURI") + GetConfigSetting(ConfigSectionName, "TFSTeamProjectCollection");
                TfsTeamProjectCollection prjCol = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(strTFSCollection));
                WorkItemStore store = prjCol.GetService<WorkItemStore>();
                string wiqlQuery = "SELECT [System.ID], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State] FROM WorkItems WHERE [System.TeamProject] = 'CorpInc'";
                wiqlQuery +=  " AND [System.AreaPath] = '" + projectName + "'" + "  AND  [State] = 'New' AND  [System.WorkItemType] in ('Bug','User Story')  ORDER BY [System.ID]"; 
                WorkItemCollection witCollection = store.Query(wiqlQuery);
                return witCollection;

    Here is what I'm running from the server. My question is: the id's coming back from the server are 4 digit numbers, but the above query gives me a work item collection where the id's are up in the 37000 range. What's the story? Is there some internal id that I need to grab?


    Friday, January 8, 2016 6:35 PM


  • Hi KathyL,

    Based on my test in VS 2015 with TFS 2015, it works fine.

    Please make sure you check the ID property correctly. (refer to my screenshot)

    If the issue still persist, please try it with a new work item and check the result.

    1. Create a new work item
    2. Query this work item in your code and check the Id



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 11, 2016 9:32 AM