質問

I've been tasked with creating a small application to query a customer database, and map its bug entries into TFS. All is well with nearly everything so far. My customer db queries work, and I can easily create a new WorkItem and place it into TFS. But I'm stuck trying to populate an HtmlFieldControl with the contents of a WorkItem Template we use for bugs. I've found the XML for this template stored on our NAS, which I assume was created through TFS PowerTools. The file has a .wt extension. Once I'm done with this, the contents of the Value element should appear in the HtmlFieldControl.

<Template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <FieldValues>
    <FieldValue>
      <ReferenceName>Microsoft.VSTS.TCM.ReproSteps</ReferenceName>
        <Value>...</Value>
    </FieldValue>
  </FieldValues>
  <WorkItemType>Bug</WorkItemType>
  <TeamServerUri>...</TeamServerUri>
  <TeamProjectName>...</TeamProjectName>
  <Description />
</Template>

I can't find any documentation on this particular element anywhere, so I have no clue how it could fit into the existing bug WorkItemType.

The template is stored as such on TFS:

Work Item Template Location in TFS

It should appear in the Work Item Form itself like this:

The Work Item Template in its rightful place

If there is no way to accomplish this, how could I take a peak at the XML of this populated form to see what I'm supposed to do?

役に立ちましたか?

解決

When creating a new WorkItem and populating fields, I found that there was a custom field in place called "Repro Steps," so I fed in the template as such:

workItem.Fields["Repro Steps"].Value = templateText;

Works like a charm.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top