0
votes

I have a custom workflow created on our self-hosted Azure DevOps server. Currently, it's based on the XML that defines the Basic workflow apart from a new name and description.

I'm trying to add a field to the epic work-item type called "Contact Person." Using System.AssignedTo as a template, I've added this new field to"

  • WIT/FIELDS (as FIELD)
  • WIT/FORM/Group/Column/TabGroup/Tab("Features")/LinkColumns (As LinkColumn)
  • WIT/FORM/Group/Column/TabGroup/Tab("All Links")/LinkColumns (As LinkColumn)
  • WIT/FORM/Group("Planning")/Column (As Control)

I didn't add the custom field to SystemControls because that was causing a parse error. I did try the four above in various combinations. None caused errors, but none caused the field to appear when I create a new epic.

I've been up and down the documentation without answers. How do I edit the workflow to add this field? And is there anything like a linter that will tell me if my XML isn't going to do work the way it's supposed to?

2
Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.Leo Liu-MSFT

2 Answers

1
votes

Azure DevOps Server: - Adding a field to a work-item type

The reason for this issue is that:

I didn't add the custom field to SystemControls because that was causing a parse error.

Indeed, the System namespace is used only to define all core system fields that are mandatory for Team Foundation system functions. Team Foundation Server prevents you from creating your own System.X field because it might impede Team Foundation Server functionality.

On-premises XML process model:

You can modify select elements within the SystemControls section, such as changing the EmptyText attribute value for the System.Title field. In general, we recommend you don't customize this section much more than that. For example, you can't remove fields from or add other fields within this section.

So, we could not add the custom field under the SystemControls. But we need add it under the Section, check following scripts:

  <Section>
    <Group Label="Planning">
      <Control Label="Priority" Type="FieldControl" FieldName="Microsoft.VSTS.Common.Priority" />
      <Control Label="ContactTo" Type="FieldControl" FieldName="Custom.ContactTo" />
      <Control Label="Start Date" Type="DateTimeControl" FieldName="Microsoft.VSTS.Scheduling.StartDate" />
      <Control Label="Target Date" Type="DateTimeControl" FieldName="Microsoft.VSTS.Scheduling.TargetDate" />
    </Group>
  </Section>

The ContactTo is my custom label.

Then, we could see it in the custom process:

enter image description here

Hope this helps.

1
votes

Here is the doc: Add or modify a field to track work. In your steps:

  • WIT/FIELDS (as FIELD) - ok
  • WIT/FORM/Group/Column/TabGroup/Tab("Features")/LinkColumns (As LinkColumn) is not needed
  • WIT/FORM/Group/Column/TabGroup/Tab("All Links")/LinkColumns (As LinkColumn) is not needed
  • WIT/FORM/Group("Planning")/Column (As Control) - ok but it applies only to the old form

Additionally, you should add to the WIT/FORM/WebLayout/Page/Section/Group as Control to see it on the web form: WebLayout and Control elements.