Share via


Change the Work Item Form Layout

You can change the work item form layout by exporting the XML file and modifying the contents of the FORM section. After you modify and import the XML file, you can verify the changes you made in the updated work item type. Types of layout changes you can make include but are not limited to the following:

  • Change the label or placement of a field on the form

  • Move groups of fields from one tab to another

  • Add new tabs or columns

For an overview of the controls you can place in a work item form, see Specify Work Item Form Controls. For an overview of the top-level structural elements for the FORM section, see. Design the Layout of the Work Item Form.

In this topic

  • Export and Open the Work Item Type Definition File

  • Change the Layout of the FORM Section of the Definition File

  • Verify the Changes Appear in the Work Item Form

Required Permissions

To perform this procedure, you must be a member of the Team Foundation Administrators group or a member of the Project Administrators group for the project. For more information, see Team Foundation Server Permissions.

Export and Open the Work Item Type Definition File

To export and open the work item type definition file

  • Perform one of the following steps based on the scope of the customization you are making:

    If you are modifying a work item type for a single project:

    1. Run witadmin exportwitd to export the XML file for the work item type you want to modify. For more information, see Customizing and Managing Work Item Types [witadmin].

      Note

      If you are running Windows Vista you might not have access rights to certain folders. If you try to export the work item type to a location where you do not have access rights, the registry virtualization technology automatically redirects the exported file and saves it to the virtual store. To avoid this redirection, you can export the file to a location where you have access rights. For more information about registry virtualization, see the following pages on the Microsoft Web site: Registry Virtualization and Common file and registry virtualization issues in Windows Vista.

    2. In Visual Studio, click File, click Open, and then click File.

    3. This displays the Open File dialog box.

    4. Under Look in, move to the location where you exported the file.

    If you are modifying a work item type to customize a process template:

    1. Move to the location where you downloaded the process template.

    2. Select the work item type XML file that you want to update, and then click Open. When you are prompted about line endings, click No.

Back to top

Change the Layout of the FORM Section of the Definition File

To change the form layout

  1. Find the <TabGroup> section of the XML file. Notice that there are <Tab> elements for items such as Links and File Attachments in which each <Tab> element contains a <Control> element that renders the respective control.

    <Tab Label="Links">
      <Control Type="LinksControl" />
    </Tab>
    <Tab Label="File Attachments">
      <Control Type="AttachmentsControl" />
    </Tab>
    
  2. Merge the two <Tab> elements into a single Links and Attachments <Tab> element that contains both controls by replacing the XML shown in the previous step with the new XML shown in the following example:

    <Tab Label="Links and Attachments">
      <Control Type="LinksControl" Label="Links" LabelPosition="Top" />
      <Control Type="AttachmentsControl" Label="Attachments" LabelPosition="Top" />
    </Tab>
    
  3. Find the section of the <FORM>, <Layout> definition that describes the group you want to modify, such as the Classification group.

    <Group Label="Classification">
      <Column PercentWidth="100">
        <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="Area" LabelPosition="Left" />
        <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="Iteration" LabelPosition="Left" />
      </Column>
    </Group>
    

    Note

    For best results, every control or group should display in a column even if the column spans the full width of the form. In turn, every column should display in a group even if the group has no visible label or boundary.

  4. Select the following lines, shown as highlighted in the following example, and then click Copy on the Edit menu to copy this content to the clipboard for later use.

      <Column PercentWidth="70">
        <Group>
          <Column PercentWidth="100">
            <Group Label="Classification">
              <Column PercentWidth="100">
                <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="Area" LabelPosition="Left" /> 
                <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="Iteration" LabelPosition="Left" /> 
              </Column>
            </Group>
          </Column>
        </Group>
      </Column>
    
  5. Delete the lines shown as highlighted in the following XML, to remove the Classification group from its current position on the form.

    <Layout>
      <Group>
        <Column PercentWidth="70">
          <Control Type="FieldControl" FieldName="System.Title" Label="&amp;Title:" LabelPosition="Left" />
        </Column>
        <Column PercentWidth="30">
          <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Discipline" Label="&amp;Discipline:" LabelPosition="Left" />
        </Column>
      </Group>
      <Group Label="Classification"> 
        <Column PercentWidth="100"> 
          <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="&amp;Area:" LabelPosition="Left" /> 
          <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="&amp;Iteration:" LabelPosition="Left" /> 
        </Column> 
      </Group>
    
  6. In the <TabGroup> section, find the following lines that define the Details tab:

    <Tab Label="Details">
      <Group>
        <Column PercentWidth="50">
          <Group Label="General">
            <Column PercentWidth="100">
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Issue" Label="Iss&amp;ue:" LabelPosition="Left" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.ExitCriteria" Label="E&amp;xit criteria:" LabelPosition="Left" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Build.IntegrationBuild" Label="Integration &amp;build:" LabelPosition="Left" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.TaskHierarchy" Label="Task C&amp;ontext:" LabelPosition="Left" ReadOnly="True" />
            </Column>
          </Group>
        </Column>
        <Column PercentWidth="50">
          <Group Label="Schedule">
            <Column PercentWidth="100">
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.RemainingWork" Label="Remaining &amp;work (hours):" LabelPosition="Left" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.CompletedWork" Label="Com&amp;pleted work (hours):" LabelPosition="Left" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.StartDate" Label="Start Dat&amp;e:" LabelPosition="Left" ReadOnly="True" />
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.FinishDate" Label="&amp;Finish Date:" LabelPosition="Left" ReadOnly="True" />
            </Column>
          </Group>
        </Column>
      </Group>
    </Tab>
    
  7. Paste the contents of your clipboard into the following location to move these controls to the Details tab.

    <Tab Label="Details">
      <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="Area" LabelPosition="Left" /> 
      <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="Iteration" LabelPosition="Left" />
      <Group>
        <Column PercentWidth="50">
          <Group Label="General">
            <Column PercentWidth="100">
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Issue" Label="Iss&amp;ue:" LabelPosition="Left" />
    ...
    
  8. Make the following changes, shown as highlighted in the following example, to create a grouping around the moved fields and to divide the fields into two columns:

    <Tab Label="Details">
      <Group Label="Classification"> 
        <Column PercentWidth="50"> 
          <Group> 
            <Column PercentWidth="100"> 
              <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="Area" LabelPosition="Left" />
              <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="Iteration" LabelPosition="Left" />
            </Column> 
          </Group> 
        </Column> 
        <Column PercentWidth="50"> 
          <Group> 
            <Column PercentWidth="100"> 
              <Control Type="FieldControl" FieldName="MyCompany.MyProcess.Category" Label="Category" LabelPosition="Left" />
            </Column> 
          </Group> 
        </Column> 
      </Group>
      <Group>
        <Column PercentWidth="50">
          <Group Label="General">
            <Column PercentWidth="100">
              <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Issue" Label="Iss&amp;ue:" LabelPosition="Left" />
    ...
    
  9. On the toolbar, click Save to save the changes to the XML file.

  10. To import the new work item type to a single project, see Customizing and Managing Work Item Types [witadmin]. To add the work item type to your process template, see Add Type Definitions for Work Items to a Process Template.

Back to top

Verify the Web Page or HTML Content Appears in the Work Item Form

To verify changes imported to a single project

  1. In Team Explorer, click Refresh to download the latest updates from the server.

    These updates include the changes that you just imported. Wait several seconds until the Work Items node is loaded. Nodes that are still loading display the word working.

  2. Create a new work item by using the work item type you modified. To do this, right-click the Work Items node, point to Add Work Item, and then click the work item type.

    This work item is created from the work item type that you changed.

    Notice that the Classification group is no longer on the main form. Click the Links and Attachments tab and the Details tab to see the results of the changes that you made.

  3. Click Close to close the new work item. Click No when you are prompted to save the work item.

Back to top

See Also

Tasks

Change the Label for a Field

Add and Customize a Type of Work Item

Reference

Customizing and Managing Work Item Types [witadmin]

Concepts

Design the Layout of the Work Item Form

Specify Work Item Form Controls

Design and Customize a Work Item Form