Sdílet prostřednictvím


FAQ: Why I am not able to link my test case to my requirement?

One question that I have been asked multiple times is -

When I’m trying to bind the user scenario with the test cases through Microsoft Test Manager, I see the link type “Tests” but this is not letting me associate the user scenario to the test case. What am I missing here?

The error shows like below in MTM (and similar issue is there in VS too) -

NotAbleToAddLink

The reason for this is that with TFS 2010, the Work Item Tracking has a notion of Work Item Category.  There are type of links that are allowed only for certain categories.  For example, in the above case the “Tests” link is allowed only to an item belonging to Microsoft.RequirementCategory. (Similarly a “Tested By” link is allowed only to an item belonging to Microsoft.TestCaseCategory.)

In the above case, user is getting the error because the item she is trying to associate does not below the the Requirement category.  The reason for that in this case was that user had created their own custom work item type. The fix is to add this custom work item type to the appropriate category.  To do so, refer this blog by Rubel in our team.

Comments

  • Anonymous
    January 02, 2011
    In the process template the filter condition should be something like "in category RequirementCategory", but it is WorkItemType=Requirement. I have tried to change to the Category, but it does not seem to work...

  • Anonymous
    January 03, 2011
    Hi Tomas, Could you elaborate which filter condition you are talking about? Thanks.

  • Anonymous
    January 04, 2011
    Tried to add a filter as below, this is in TestCase to add just Requirement Categories to this linkcontrol <Control Type="LinksControl" Name="Tested" Label="Requirements tested by this Test Case" LabelPosition="Top">              <LinksControlOptions>                <WorkItemLinkFilters FilterType="include">                  <Filter LinkType="Microsoft.VSTS.Common.TestedBy" FilterOn="reversename"/>                </WorkItemLinkFilters>                <WorkItemTypeFilters FilterType="include">                  <Filter WorkItemType="in group Requirement Category" />                  </WorkItemTypeFilters>                <ExternalLinkFilters FilterType="excludeAll"/>                <LinkColumns>                  <LinkColumn RefName="System.ID" />                  <LinkColumn RefName="System.WorkItemType" />                  <LinkColumn RefName="System.Title" />                  <LinkColumn RefName="System.AssignedTo" />                  <LinkColumn RefName="System.State" />                  <LinkColumn LinkAttribute="System.Links.Comment" />                </LinkColumns>              </LinksControlOptions> At first this seemed to work, but not any more. I guess I made some mistake back then. The syntax is not documented as far as I can see.

  • Anonymous
    January 06, 2011
    @Tomas - Sorry, it took time to get back on this because I wanted to confirm with some WIT expert before getting back to you. In the current release, the WorkItemType filter only works with work item types, not with work item catagories.  So your change will not work.

  • Anonymous
    January 06, 2011
    Thanks for the answer - I hope you will fix this for the next release!