none
query shelvesets by workitem links?

    Question

  •  

    in order to facilitate our review process, we'd like to be able to create shelvesets and link them to work items (which works currently).

     

    is there an API that will allow one to query shelvesets by their workitem links?

    Thursday, July 10, 2008 5:16 PM

Answers

  • you can query for all shelvesets, and then search each shelveset for workitem, the code will look like:

     

    Code Snippet

    Shelveset[] shelvesets = m_vcs.QueryShelvesets(null, null); //Get all existing shelveset

     

    foreach (Shelveset shelveset in shelvesets)

    {

    foreach (WorkItemCheckinInfo wi in shelveset.WorkItemInfo)

    {

    if (wi.WorkItem.Id == myId)

    {

    //Display shelveset info

    }

    }

    }

     

     

     

    Thursday, July 10, 2008 6:05 PM

All replies

  • you can query for all shelvesets, and then search each shelveset for workitem, the code will look like:

     

    Code Snippet

    Shelveset[] shelvesets = m_vcs.QueryShelvesets(null, null); //Get all existing shelveset

     

    foreach (Shelveset shelveset in shelvesets)

    {

    foreach (WorkItemCheckinInfo wi in shelveset.WorkItemInfo)

    {

    if (wi.WorkItem.Id == myId)

    {

    //Display shelveset info

    }

    }

    }

     

     

     

    Thursday, July 10, 2008 6:05 PM
  • thanks,  that should get me going on that.  are there any plans to improve the querying of shelvesets so you don't always have to get every shelveset on the server just to do basic filtering?

     

    one follow-up question:  I am planning to store additional review data associated with shelvesets and changesets in a custom database.  Are there any server events (similar to WorkItemChanged) that would tell me when a shelveset is deleted?  i found a post that listed some of the events, but nothing jumped out as telling me about shelvesets.

     

    Thursday, July 10, 2008 9:30 PM