How to: Link from Work Items to Model Elements

This Visual Studio 2010 feature pack lets you view model elements in Visual Studio 2010 Ultimate that are linked to work items in Team Foundation Server 2010 or Team System 2008 Team Foundation Server. By installing the model artifact link type, you can use these links to help you track and monitor the progress of work, for example, for a particular activity or tests for a use case. For more information, see Visual Studio Feature Packs.

Note

You must install a Visual Studio 2010 Feature Pack to use this feature.

In Visual Studio 2010 Ultimate, only links from model elements to new or existing work items are supported. For more information, see How to: Link from Model Elements to Work Items. You can create and view links between model elements and work items only in Visual Studio 2010 Ultimate, not Visual Studio 2010 Premium.

In This Topic

  • Requirements

  • Create links or view links from work items to model elements

  • Remove links from work items

  • Troubleshooting

Requirements

Before you start this task, make sure that the following requirements have been met:

  • Install the model link type on Team Foundation Server 2010 or Team System 2008 Team Foundation Server.

    Note

    This task requires administrator privileges on Team Foundation Server. You will not be able to create or view links from work items unless this link type is installed.

  • Make sure that the solution contains a modeling project that has model elements, and that the solution is open.

    To add a modeling project and model elements, see How to: Create UML Modeling Projects and Diagrams.

  • To allow other users to open the diagrams, make sure that the modeling project and diagrams are checked into Team Foundation version control. To open the diagrams, you must your workspace mapped to the modeling project. If you do not have a workspace, you must create it. For more information, see Troubleshooting and Create and Work With Workspaces.

  • Choose one of the following:

    To install on

    Follow these steps

    Team Foundation Server 2010

    1. On the computer that has the feature pack installed, browse to the following folder:

      If you have the Visual Studio 2010 Visualization and Modeling Feature Pack installed:

      C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\<InsertVisualStudioFeaturePackName>\1.0

      - or -

      C:\Documents and Settings\UserName\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\<InsertVisualStudioFeaturePackName>\1.0

      If you have the Visual Studio 2010 Feature Pack 2 installed:

      …\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\<InsertVisualStudioFeaturePackName>\<InsertVisualStudioFeaturePackVersionNumber>\Server Install Scripts

    2. Find the following file, and then copy it:

      Microsoft.VisualStudio.ArchitectureTools.WorkItemLinking.ServerRegistration.dll

    3. On the computer that has Team Foundation Server, browse the application-tier installation path to find the Plugins folder. For example:

      DriveName:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\bin\Plugins

    4. Paste the .dll file in the Plugins folder.

    5. To load the .dll on Team Foundation Server, you must use Internet Information Services (IIS) Manager to recycle the Team Foundation Server application pool or to restart the IIS Server.

      To open IIS Manager, see How to: Open IIS Manager.

      To recycle the application pool

      1. In the left pane, expand the <InsertServerName> node, and then click Application Pools.

      2. In the right pane, right-click Microsoft Team Foundation Server Application Pool, and then click Recycle.

      To restart the IIS Server

    6. After the link type is installed, clear the Team Foundation cache on the client as follows:

      1. Browse to the following location:

        C:\Users\UserName\AppData\Local\Microsoft\Team Foundation\<InsertTeamFoundationVersionNumber>

      2. Find the Cache folder, and then delete it.

    Team System 2008 Team Foundation Server

    1. On the computer that has the feature pack installed, browse to the following folder:

      If you have the Visual Studio 2010 Visualization and Modeling Feature Pack installed:

      C:\Users\UserName\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\<InsertVisualStudioFeaturePackName>\1.0\Server Install Scripts

    2. If you have the Visual Studio 2010 Feature Pack 2 installed:

      …\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\<InsertVisualStudioFeaturePackName>\InsertVisualStudioFeaturePackVersionNumber\Server Install Scripts

    3. Find the following file:

      ArchitectureToolsRegistrationEntriesTFS2008.xml

    4. Copy the file to a location where TFSReg.exe can access the file from the Team Foundation Server application tier.

    5. On the computer that has Team Foundation Server, open an elevated Command Prompt. On the Start menu, right-click Command Prompt, and then click Run as Administrator.

    6. Browse to the following folder on the Team Foundation Server application tier:

      DriveName:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools

    7. Run TFSReg.exe as follows:

      TFSReg.exe ArchitectureToolsRegistrationEntriesTFS2008.xml <InsertTeamFoundationServerDataTierServerName>

      For more information, see TFSReg.

    8. After the link type is installed, clear the Team Foundation cache on the client as follows:

      1. Browse to the following location:

        C:\Users\UserName\AppData\Local\Microsoft\Team Foundation\<InsertTeamFoundationVersionNumber>

      2. Find the Cache folder, and then delete it.

Though you can link to model elements from work items, it is recommended that you create the link starting from the model element. You can also view a linked model element from a work item. If your team does not use Team Foundation version control, the local path of the diagrams will be used to create the links. If the modeling project and its diagrams are in Team Foundation version control, all team members who can access the project can view linked elements in work items.

Important

If a work item does not show the linked UML elements that you expect, try refreshing the work item manually, or closing and then reopening your query. To enable bidirectional links between layer elements and work items, install Visual Studio 2010 Service Pack 1. Otherwise, you will have to create the link from the work item.

  • Open the work item, and then follow the relevant steps:

    In

    Follow these steps

    Team Foundation Server 2010

    1. Click the Links tab, and then click Link to.

    2. From the Link type list in the Add Link to dialog box, select the Model Link type.

    3. Click Browse to find and select a model element.

    For more information, see Creating Relationships Between Work Items and Other Resources.

    Team System 2008 Team Foundation Server

    1. Click the Links/Attachments tab, and then under Links, click Add.

    2. From the Link type list in the Add Link dialog box, select the Model Link type.

    3. Click Browse to find and select a model element.

    For more information, see Working with Links and Attachments in Work Items.

To view a linked model element from a work item

  • Open the work item, and then double-click the link to the model element.

    -or-

    Follow the relevant steps:

    In

    Follow these steps

    Team Foundation Server 2010

    Click the Links tab, click the model element link, and then click Open Linked item.

    For more information, see Creating Relationships Between Work Items and Other Resources.

    Team System 2008 Team Foundation Server

    Click the Links/Attachments tab, click the model element link, and then click Open.

    For more information, see Working with Links and Attachments in Work Items.

    After you perform this step, the diagram opens and displays the linked element.

When you remove a link from a model element, the link from the work item is also removed. It is not recommended that you edit the work item to remove the link to the model element because the link from the model element to the work item will not be removed. Instead, remove the work item link from the model element. For more information, see How to: Link from Model Elements to Work Items.

Troubleshooting

Issue

Possible cause

Resolution

Cannot find the model element.

The model artifact link type might not be installed on Team Foundation Server.

Install the model artifact link type on Team Foundation Server.

For more information, see Requirements.

Cannot find the model element.

The element might be on a diagram in a modeling project that is in Team Foundation version control. You might not have a workspace that maps to the diagram.

Map your workspace to the modeling project and diagram. If you do not have a workspace, then you must create it.

The error message that appears for this issue contains the path that you can use to map your workspace.

For more information, see Create and Work With Workspaces.

Cannot find the linked model element.

The linked element might be on a diagram that has been moved, renamed, or deleted.

  1. In the work item, delete the link to the model element.

  2. Create a new link from the work item to the model element.

For more information, see Create links or view links from work items to model elements.

External Resources

Linking Work Items to UML Model Elements with the VS 2010 Feature Pack

See Also

Concepts

Using Models within the Development Process

How to: Link from Model Elements to Work Items