azure-devops-serverazure-devops-server-2020

Showing swimlane in detail view


I have a custom 'work item type' in an on-premise TFS. I want to show the System.BoardLane field (the swimlane of the item) in the detail view of an item (when clicking the item in kanban board). I see that the field is already referenced in the <FIELDS> list, so I just added a Control tag in the WebLayout like so:

<?xml version="1.0" encoding="utf-8"?>
<witd:WITD application="Work item type editor" version="1.0" xmlns:witd="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE name="My Custom WIT">
    <FIELDS>
      <!-- ... -->
      <FIELD name="Board Column" refname="System.BoardColumn" type="String" reportable="dimension" />
      <FIELD name="Board Column Done" refname="System.BoardColumnDone" type="Boolean" reportable="dimension" />
      <FIELD name="Board Lane" refname="System.BoardLane" type="String" reportable="dimension" />
      <!-- ... -->
    </FIELDS>
    <FORM>
      <WebLayout>
        <Page Label="Details" LayoutMode="FirstColumnWide">
          <Section>
            <Group Label="Other">
              <!-- ... -->
              <Control Label="Board Lane" Type="LabelControl" FieldName="System.BoardLane" ReadOnly="True" />
              <Control Label="Board Column" Type="LabelControl" FieldName="System.BoardColumn" ReadOnly="True" />
              <!-- ... -->
            </Group>
          </Section>
        </Page>
      </WebLayout>
    </FORM>
  </WORKITEMTYPE>
</witd:WITD>

But when I tried to import this modified WITD with witadmin it throwed an error:

TF237090: Does not exist or access is denied.

Is it possible to show board lane in an item's detail view using this way? If not, is there another way to show swimlane in detail view?


Solution

  • Silly me, it was because the user that I used to run witadmin didn't have enough privilege. After switching to a more privileged user the WITD was accepted.

    But LabelControl didn't display the content of the field so I switched to FieldControl:

    <Control Label="Board Lane" Type="FieldControl" FieldName="System.BoardLane" />
    

    No need to use attribute ReadOnly="True" because the control is already locked by TFS.