locked
How can I display the IDs of linked Work Items in a custom field? RRS feed

  • Question

  • Hi, 

    I have created a custom field and added it to the Test Case.wit.  I would like to display the IDs of all linked User Stories in this custom field.  I saw on another MSDN forum that creating a custom control would help me do this, however, I couldn't figure out how exactly to do this.  If you could provide specific steps (and maybe screenshots and the code, if any, that I need to use) I would really appreciate it. 

    Thanks, 

    The Tragic TFS Admin



    • Edited by tfsRashida Friday, August 14, 2015 3:09 PM Typo
    Friday, August 14, 2015 3:09 PM

Answers

All replies

  • Hi,

    Which forum/thread that you referred to?

    The test case work item has the TESTED USER STORIES tab that list the User Stories.

    Regards

    Starain


    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, August 17, 2015 9:04 AM
    Moderator
  • Starain,

    I know that I can view that information in the TESTED USER STORIES tab, but I need the IDs of the linked item to be autopopulated and displayed in the custom field I have created.  

     The forum/thread I referred to is located below.  The question and respsonse to that thread may give you a better idea of what exactly I'm trying to do. 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/bbbf666b-0837-4c56-b6db-9e17bb4a2d29/link-parent-task-id-to-a-custom-field

    Thanks


    • Edited by tfsRashida Monday, August 17, 2015 12:42 PM typo
    Monday, August 17, 2015 12:41 PM
  • Hi tfsRashida,

    Do you mean you want to have a custom control with all User Story workitems’ ID, then you could create a test case and select a User Story?

    Regards

    Starain


    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.

    Tuesday, August 18, 2015 5:35 AM
    Moderator
  • This is the scenario:

    • I created a custom field on the Test Case WIT called "Traced".
    • I created a test case and linked it to the User Stories that it references.

    I would like the IDs of the User Stories that are linked to the test case to display in the "Traced" field. 

    My question: how can I do this?

    Thursday, August 20, 2015 1:55 PM
  • Hi,

    There isn’t the rule could do that. For LinksControl control, there is LinksControlOptions that could add filters and query the result.

    In my opinion, the way that you said to use WCF to subscribe the TFS event service is a good way to achieve that, if you have the problem that you achieve that with that way, please feel free to post it here or open the new thread.

    On the other hand, you could add a new field and control to the Test Case work item, then using the TFS API to update test cases.

    More information, please refer to:

    # Customize your Test Case work item template to enable query on test suites, test plans, test categories and execution statistics

    http://blogs.msdn.com/b/vstsqualitytools/archive/2011/09/21/customize-your-test-case-work-item-template-to-enable-query-on-test-suites-test-plans-test-categories-and-execution-statistics.aspx

    To get the user stories of test case by using TFS API, you could get the collection of links from WorkItem.Links property, then get the workitem id and get the specified workitem by using WorkItemStore.GetWorkItem method. You also could use query to get the result.

    There are some threads that can help you:

    # How to find number of TFS test cases for a given bug with API

    http://stackoverflow.com/questions/11640585/how-to-find-number-of-tfs-test-cases-for-a-given-bug-with-api

    # Using stored queries from TFS in work item API

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/0846c85e-7fd9-4a88-8b0a-21ea27c8ab68/using-stored-queries-from-tfs-in-work-item-api

    Regards

    Starain


    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, August 24, 2015 6:04 AM
    Moderator