Customizing and Managing Link Types
You can manage the link types defined for a team project collection by using the following witadmin commands:
deactivatelinktype: Deactivates the specified link type. Users will no longer be able to create links of this type. Existing links of this type will continue to function correctly.
deletelinktype: Permanently removes the specified link type from the database. All links defined with this link type are also removed.
exportlinktype: Exports the definitions of link types. You can export the definition of a single link type or all link types defined for the server.
importlinktype: Imports the definitions of link types from an XML file. If a link type with the same reference name already exists, it will be updated to match the imported link type. If the link type does not already exist, a new link type will be created.
listlinktypes: Lists the available set of link types on a server.
reactivatelinktype: Reactivates the specified link type, and optionally assigns it a new name.
The witadmin command-line utility is located in Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on the client computer that runs Team Explorer.
Poznámka
You can create and modify link types by using Process Editor, a power tool for Visual Studio. This tool is not supported. For more information, see the following page on the Microsoft Web site: Team Foundation Server Power Tools April 2010.
Required Permissions
For the project collection where the link types are defined, you must have the following permissions set:
To list or export link types, you must be a member of the Readers group or have your View work items in this node permission set to Allow
To delete, import, or reactive link types, you must be a member of the Team Foundation Administrators security group or the Project Administrators security group.
For more information, see Team Foundation Server Permissions and Team Foundation Server Default Groups, Permissions, and Roles.
Poznámka
Even if you log on with administrative permissions, you must open an elevated Command Prompt window to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt window, click Start, right-click Command Prompt, and then click Run as Administrator. For more information, see the Microsoft Web site: User Access Control.
witadmin deactivatelinktype /collection:CollectionURL /n:LinkName
witadmin deletelinktype /collection:CollectionURL /n:LinkName [/noprompt]
witadmin exportlinktype /collection:CollectionURL [/n:LinkName] [/f:FileName] [/e:Encoding]
witadmin importlinktype /collection:CollectionURL /f:FileName [/e:Encoding] [/v]
witadmin listlinktypes /collection:CollectionURL
witadmin reactivatelinktype /collection:CollectionURL /n:LinkName
Parameters
Parameter |
Description |
---|---|
/collection:CollectionURL |
Specifies the URI of the team project collection. The format for the URI is the following: http://ServerName:Port/VirtualDirectoryName/CollectionName For example: http://ServerName:8080/tfs/Collection0 If a virtual directory is not used, then the format for the URI is the following: http://ServerName:Port/CollectionName |
/n:LinkName |
The name or the reference name of the link type to deactivate or delete. |
/f:FileName |
The XML file of link types. Required for import, optional for export. If you omit this parameter, the command output appears on the display. |
/e:encoding |
The name of a .NET Framework 2.0 encoding format. The specified encoding will be used to export or import the XML data. For example, /e:utf-7 specifies Unicode (UTF-7) encoding. If you omit this parameter, witadmin attempts to detect the encoding, and if detection fails, witadmin uses UTF-8. |
/v |
Validates the link type XML without importing it. |
/noprompt |
Disables the prompt for confirmation. |
/? or help |
Displays help about the command in the Command Prompt window. |
Remarks
For the structure of the link type definition schema, see Working with Link Types.
Examples
Unless otherwise specified, the following values apply in each example:
URI for the team project collection: http://AdventureWorksServer:8080/AWTeam/Collection1
Server name: AdventureWorksServer
Input or output file name: myLinkTypes.xml
Link type name: mylinktype
Default encoding: UTF-8
List Link Types
The following command displays the custom link types defined for Team Foundation AdventureWorksServer.
witadmin listlinktypes /collection:http://AdventureWorksServer:8080/AWTeam/Collection1
List the Definition of a Link Type
The following example displays the definition of the link type in the Command Prompt window:
witadmin exportlinktype /collection:http://AdventureWorksServer:8080/AWTeam/Collection1
Deactivate and then Reactivate a Link Type
The following examples deactivate the link type, mylinktype, and then reactivate it:
witadmin deactivatelinktype /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /n:mylinktype
witadmin activatelinktype /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /n:mylinktype
Export the Definition of a Link Type
The following command exports the definition of all link types to the file, mylinktype.xml:
witadmin exportlinktype /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /f:mylinktype.xml
Import the Definition of Link Types
The following example imports the definition of the link types defined in the XML file:
witadmin importlinktype /collection:http://AdventureWorksServer:8080/AWTeam/Collection1 /f:mylinktype.xml
See Also
Tasks
Concepts
Other Resources
Creating Relationships Between Work Items and Other Resources