Link Model Elements and Work Items
In Visual Studio Ultimate, you can link any model element to Team Foundation Server work items. This lets you track tasks, test cases, bugs, requirements, issues, or other kinds of work associated with your model. You can also associate any document to a model element by attaching the document to a linked work item.
Note |
|---|
You can make these links only if your project uses Team Foundation Server and you have Team Explorer installed on your computer. To let other users open linked diagrams and elements, make sure the modeling project and diagrams are checked into Team Foundation version control. |
For example, you can make these links:
Link a user story work item to an activity diagram that explains how to realize the story as a sequence of operations.
Link a use case on a use case diagram to the test case work items that make sure the use case is implemented correctly.
Link an attribute in a class on a UML class diagram to a bug work item about an error in the implementation of the attribute.
Link a component in a component diagram to a task work item that tracks the component's development. Such a task is usually the parent of several smaller tasks.
You can link work items to any element that you can select on the diagrams or in UML Model Explorer. This includes the following:
All elements in UML models, such as UML classes, lifelines, use cases, subsystems, activities, object nodes, components, interfaces
All relations in UML models, such as associations, generalizations, dependencies, flows, messages
Parts of elements, such as the attributes and operations of classes, the execution occurrences of lifelines, the input and output pins of activities, and the parts and ports of components
Layers and layer dependencies
Comments and comment links
Diagrams. To select a diagram, choose a blank part of the diagram.
On the modeling diagram or in UML Model Explorer, open the shortcut menu for the model element. Choose Create Work Items and the kind of work item that you want to create.
A work item form appears.
Fill in the fields of the work item. Choose Save Work Item.
Visual Studio links the model element to the new work item. An icon appears on or near the model element.
On the modeling diagram or in UML Model Explorer, open the shortcut menu for the model element. Choose Link to Work Item.
In the Link to Work Items dialog box, select your project in the Project field.
Choose one or more work items to link to the model element by using one of the following steps:
Choose a query in Saved Query.
Type the IDs of one or more work items, separated by spaces, in IDs.
Type a word or phrase in Title Contains.
Choose Find.
A list of work items appears.
Select the check boxes for the work item or work items that you want. Choose OK.
The Work Items property of the model element shows a larger number than before. An icon appears on or near the model element.
When linking model elements to work items, it is recommended that you start from the model element to create the link, not from the work item.
In Team Explorer, make sure you are connected to the Team Foundation Server to which the model element is linked.
On the modeling diagram or in UML Model Explorer, open the shortcut menu for the model element. Choose View Work Items.
A work item list window opens and shows a list of connected work items.
NoteOnly work items in the currently selected server are shown. If the list is empty, make sure you selected the correct server in Team Explorer.
If you are using Team Foundation Server 2012, you can view model elements that are linked to a work item. For example, a work item might be linked to class models that illustrate the design of new classes to be implemented.
Note |
|---|
In this release, you can view only new links to model elements. To open the diagrams, make sure your workspace is mapped to the modeling project. If you do not have a workspace, you must create it. See Troubleshooting and Create and Work with Workspaces. |
In the work item, choose Other Links. Under Model Link, open the shortcut menu for the linked model element. Choose Open Linked Item.

The diagram that contains the linked model element opens.
On the modeling diagram or in UML Model Explorer, open the shortcut menu for the model element.
Choose Remove Work Items.
- or -
Choose Properties.
In the Properties window, the Work Items property shows the number of linked work items.
Choose the ellipsis button […] in the Work Items property.
The Remove Links to Work Items dialog box appears.
NoteOnly work items in the current server are shown. If the list is empty, but the number of work items is not zero, make sure you are connected to the correct server in Team Explorer.
Clear the check boxes next to the items that you want to unlink. Choose OK.
The work items are no longer linked to the model element.
ImportantAlways delete a link to a work item starting from the model element. This ensures that Visual Studio deletes the link to the model element from the work item. If you delete the link starting from the work item, the link from the model element to the work item will not be deleted.
Issue | Possible cause | Resolution |
|---|---|---|
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. |
Cannot find the linked model element. | The linked element might be on a diagram that has been moved, renamed, or deleted. |
|
The work item does not show the linked model elements that you expect. | A work item shows a linked layer element only if the link was created from the 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. | Try refreshing the work item. |
Deleting a link to a model element from a work item doesn't delete the link from the model element to the work item. | Delete the link to the work item starting from the model element. |