Flatten hierarchy of work items (Inner Join) RRS feed

  • Question

  • Hi there,

    we have created two new work item types: Stakeholder and ChangeRequest

    These types have a simple Parent-Child link:

      + ChangeRequest 1
      + ChangeRequest 2

      + ChangeRequest 3
      + ChangeRequest 4

    Is it possible to create a flatt query where we have columns from both types flattened?

    StakeholderB.Name      ChangeRequest.Title     ChangeRequest.Priority

    Another question:

    And is there a way to get those types in a sortable list like the backlog list (adding a stackrank field).



    Wednesday, December 28, 2016 7:01 AM


All replies

  • Hi!

    TFS does not support flat query with join. You can get that through custom reports with Report Server.

    Wednesday, December 28, 2016 11:50 AM
  • Thank you.

    But we do not want to use Report Server.

    Is there another way (export to Excel, etc.)?

    TIA, Andi

    Wednesday, December 28, 2016 1:40 PM
  • You may use custom solution:

    1. Add custom field "Customer" to CR.
    2. Write app that: get CR with empty "Customer" and with parent Customer; copy customer title to CR.

    Then you can use flat query.

    Wednesday, December 28, 2016 2:15 PM
  • Hi Alexandr,

    sounds as a solution that will work - but is not out of the box.

    Do you know what would be the simplest solution?

    Should we write a form widget to react on an onSave event and update the work item.

    But with this solution we also have to update all CR when a stakeholder name changes :(

    Are there any server tasks that may be triggered, when a work item changes?



    • Edited by duck42 Wednesday, December 28, 2016 3:52 PM
    Wednesday, December 28, 2016 3:51 PM
  • Hi!

    Another solutions:

    1. Create TFS plugin and subscribe on WorkitemChanged event. If workitemtype=CR and customer="" or customer<>parent.title, copy title from parent CR and save. http://www.almguide.com/2011/12/tfs-server-side-event-handlers/
    2. Create web-service and use web-hook to subscribe on creation and updating. https://www.visualstudio.com/en-us/docs/integrate/get-started/service-hooks/services/webhooks

    • Edited by Alexandr ShamrayMVP Wednesday, December 28, 2016 6:13 PM
    • Marked as answer by duck42 Thursday, December 29, 2016 9:40 AM
    Wednesday, December 28, 2016 6:11 PM