Python脚本在尝试获取TFS工作项时返回错误

2024-06-28 11:35:35 发布

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

我编写了以下Pythin脚本来尝试收集TFS(teamfoundationserver)工作项数据。下面是我的脚本:-在

from tfs import TFSAPI

user="andrew.xxxx"
password="xxxxxxxx"

tfsAddress = "http://man-tfsmig-1:8080/"
print(tfsAddress)

client = TFSAPI(tfsAddress, project="DefaultCollection/xxxxxxxx", user=user, password=password)

work_item = client.get_workitem(28274)

当我运行代码时,我得到以下错误,但我不知道是什么问题:-

^{2}$

Tags: 数据fromimport脚本clientpasswordtfsuser
2条回答

它告诉您错误:404,找不到。在

这意味着您为API提供的URI不正确。在

它正在生成这个URI:http://xxxx-xxxxx-1:8080/DefaultCollection/_apis/wit/workitems。验证是否正确。在

通常,当TFS通过HTTP在8080端口上运行时,会有一个/tfs/虚拟目录。在

我需要在aut中添加以下行henticate公司:-在

# Use NTLM authorization
from requests_ntlm import HttpNtlmAuth
client = TFSAPI("https://tfs.tfs.ru/tfs/", user=user, password=password, auth_type=HttpNtlmAuth)

相关问题 更多 >