WorkItemQuery to return Count of records RRS feed

  • Question

  • Below query is used to get Bugs details for given iteration and WorkItemType =Bug and Priority P1. Is there any way to get count(*) of records.

    Ex: select count(*) from sqltable  for below Query

    SELECT[System.Id], [System.State], [System.NodeName],
             [Microsoft.VSTS.Common.Priority],[Microsoft.VSTS.Common.Severity], [System.Reason],
             [System.AreaPath], [System.IterationPath] FROM WorkItems WHERE [Work Item Type] = 'Bug'

    Some think like

    SELECT count(*) FROM WorkItems WHERE [Work Item Type] = 'Bug'

     query = new Query(_store,
                                  "SELECT[System.Id], [System.State], [System.NodeName],
             [Microsoft.VSTS.Common.Priority],[Microsoft.VSTS.Common.Severity], [System.Reason],
             [System.AreaPath], [System.IterationPath] FROM WorkItems WHERE[System.IterationPath] =
             '"  + iterationPath + "' AND [Work Item Type] = 'Bug' AND [Microsoft.VSTS.Common.Priority] = 'P1');

    Friday, November 24, 2017 7:09 AM


  • Hi Anil,

    Thanks for posting here.

    When the query is created, open the query in TFS web page, the number of records could be found at the top-right corner.

    Best regards

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, November 26, 2017 4:23 AM