【发布时间】:2019-07-19 15:51:51
【问题描述】:
我已经设法通过以下方式获取项目名称:
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
def get_project_names(token):
# Fill in with your personal access token and org URL
personal_access_token = token
organization_url = '<url>'
# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
# Get a client (the "core" client provides access to projects, teams, etc)
core_client = connection.clients.get_core_client()
# Get the list of projects in the org
projects = core_client.get_projects()
# Get Project names
names = []
for project in projects:
projects_names = project.__dict__["name"]
names.append(projects)
return names
幸运的是,https://github.com/Microsoft/azure-devops-python-api 的示例几乎为此提供了一切。
现在我需要获取有关我们的测试计划的信息。我已经搜索了文档并在他们的 Github 上查看了示例,但我无法弄清楚。谁能指出我正确的方向?
谢谢!
【问题讨论】:
-
您是否收到任何特定的错误消息?你试过什么?
标签: python tfs azure-devops azure-devops-rest-api