1

I've created an extension in TFS2017. It's basically a tab to display the linked workitems with some details on the selected pull request. enter image description here

The problem is that I'm unable to get the id and other data that are needed to use them as parameters in order to use call the method getPullRequestWorkItems() which basically gets the work items on the current pull request.

The method VSS.getWebContext() doesn't provide the needed data, and I've tried to do something like window.parent.location.href but this is not because I get error like securityError: Blocked a frame with origin from accessing a cross-origin frame.

Thanks

Edit: I have installed the contribution guide extension to get the availabe context and configuration data but the configuration is empty: enter image description here

Update:

I could solve this task using the getConfiguration() as suggested by Eddie - MSFT. This requires updating TFS to 2017.1RC2 if you are the extension running onprem.

4

1 回答 1

1

您需要使用getConfiguration()方法来获取 Pull Request ID 和 Repository ID。

顺便说一句,您可以使用Contributions Guide扩展来帮助您更轻松地开发扩展。例如,安装此扩展程序后,您会发现可以获取哪些信息: 在此处输入图像描述

于 2017-02-21T01:09:49.360 回答