Udostępnij za pośrednictwem


How to: Change the Work Item Form Layout

You can change the work item form layout by exporting the XML file and modifying its content. As soon as you have modified the form layout, you can import the XML file to start to use the updated work item type.

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.

To change the form layout

  1. If you are modifying a work item type on a single project, run witexport to export the XML file for the work item type you want to modify. For more information, see How to: Export a Work Item Type from an Existing Project.

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

    This displays the Open File dialog box.

  3. 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, move to the location where you downloaded the process template.

    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. For more information, see https://go.microsoft.com/fwlink/?LinkId=92325 and https://go.microsoft.com/fwlink/?LinkId=92323. To avoid this redirection, you can export the file to a location where you have access rights.

  4. 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.

  5. 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>
    
  6. 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>
    
  7. 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.

  8. Select the following lines shown 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>
    
  9. Delete the lines shown in bold text 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>
    
  10. 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>
    
  11. 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" />
    ...
    
  12. Make the following changes, shown in bold text, 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" />
    ...
    
  13. On the toolbar, click Save to save changes to the XML file.

  14. To import the new work item type to a single project, see How to: Import a Work Item Type to an Existing Project. To add the work item type to your process template, see Work Item Types.

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 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.

See Also

Tasks

How to: Customize a Field Label

Concepts

Designing the Layout of the Work Item Form

Specifying Work Item Form Controls

All Work Item FORM Elements

Work Item Form Sample