如何从tfs中提取链接到python工作项的变更集?

2024-06-28 11:01:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用microsoftfspython库在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  

现在我有了所有的工作项,但我不知道如何访问工作项的变更集。你知道吗


Tags: fromhttpsimportgithub名称clientpasswordquery
1条回答
网友
1楼 · 发布于 2024-06-28 11:01:18

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

enter image description here

enter image description here

相关问题 更多 >