【问题标题】:How to extract the changesets linked to a workitem in python from tfs?如何从 tfs 中提取链接到 python 中工作项的变更集?
【发布时间】:2019-10-03 06:43:22
【问题描述】:

我想使用 Microsoft TFS Python 库在 python 中提取变更集和受变更集影响的类的名称。 https://devopshq.github.io/tfs/index.html

我已使用 python 连接到 TFS,并且能够检索所有必需的工作项。我想提取与工作项关联的变更集。

我已经使用以下代码进行连接。

from tfs import TFSAPI  
user="xxxxxxxxxxxxx"  
password="xxxxxxxxxxxxxx"  
from requests_ntlm import HttpNtlmAuth  
client = TFSAPI("https://xyzjds.com", project="abc", user=user,password=password, auth_type=HttpNtlmAuth)    
query = client.run_query('xxxxxxxxxxxxxxx')    
workitems = query.workitems  

现在我的所有工作项都不知道如何访问工作项的变更集。

【问题讨论】:

  • 请分享您尝试过的代码以及没有成功的地方。
  • @ShaykiAbramczyk 我已经添加了代码

标签: python python-3.x python-2.7 dictionary tfs


【解决方案1】:

变更集存在于ArtifactLink 类型的属性relations 中,因此您应该迭代工作项并检查relations 是否存在,如果存在则检查ArtifactLink 类型的关系是否存在,然后在您的网址中获取变更集 ID:

【讨论】:

  • 嘿。我找到了变更集,非常感谢。是否可以知道变更集中更改的文件?
  • @TasheerHussain 尝试使用client.get_changeset(changeset-id) 方法。
  • 我知道了,我想要更改集中更改的文件的名称。有可能吗?
  • 我不知道它是否存在于这个api中,也许你需要为tfs调用更改rest api或另一个python sdk。
  • 你知道任何有用的资源吗?我可以研究一下?
猜你喜欢
  • 2013-01-01
  • 2011-10-07
  • 2012-07-07
  • 2019-08-29
  • 2015-05-21
  • 2011-08-05
  • 2011-08-22
  • 1970-01-01
  • 2019-01-06
相关资源
最近更新 更多