TFS 2017 update2 custom page under work item not a

2019-08-16 00:35发布

I new to TFS and VSTS and created a plugin for VSTS and TFS which contribute to work item group and hub group. Its works fine for VSTS but in TFS 2017 update2 it is not showing custom page for work item. Code which is used by me.

"contributions": [
 {
     "id": "custom-sample-work-item-form-page",
     "type": "ms.vss-work-web.work-item-form-page",
     "description": "Adds Execution Result to the Work Item form group",
     "targets": [
              "ms.vss-work-web.work-item-form"
      ],
      "properties": {
             "name": "My Custom Page",
             "uri": "index.html",
             "height": 600
         }

      },

What is the root cause for this?

1条回答
劫难
2楼-- · 2019-08-16 01:36

It's only applied to VSTS by installing the extension directly. See Configure contributions in work item form.

In VSTS, by default the group extensions will appear in the end of the second column of the form and page contributions will appear after all the work item form pages as a tab. Control contributions are not shown in the form by default so users will have to manually add them to the form. In TFS, to show/hide or move the control, group and page contributions in work item form, see Configure work item form extensions in TFS.

So ,for TFS on-premise, you need to add an extension tag in the specific work item definition (xml) file.

  1. Export the work item definition file :

    witadmin exportwitd /collection:CollectionURL /p:Project /n:TypeName /f:FileName

  2. Open the xml file and find your extension ID in the "Work Item Extensions" section

  3. Add an extension tag below the "Work Item Extensions" section as shown below to make your extension available to the work item form.

    <Extensions> <Extension Id="example.color-control-dev" /> </Extensions>

  4. Save and import this .xml file.

    witadmin importwitd /collection:CollectionURL /p:Project /f:FileName

See Add extensions in work item form via work item type definition xml for details.


UPDAET:

If you need to add the tab for all the work item types, you can create a script to export/import the definition xml files. Also bulk add the extension tag with text editor such as Notepad++.

For example:

cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
witadmin exportwitd /collection:http://server:8080/tfs/CollectionLC /f:E:\CustomeWIT\Task.xml /p:TFVC-Scrum
witadmin exportwitd /collection:http://server:8080/tfs/CollectionLC /f:E:\CustomeWIT\PBI.xml /p:TFVC-Scrum

...

cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
witadmin importwitd /collection:http://server:8080/tfs/CollectionLC /f:E:\CustomeWIT\Task.xml /p:TFVC-Scrum
witadmin importwitd /collection:http://server:8080/tfs/CollectionLC /f:E:\CustomeWIT\PBI.xml /p:TFVC-Scrum

enter image description here

查看更多
登录 后发表回答