![](/img/trans.png)
[英]Azure DevOps How to add test existing test cases by test suite id
[英]Get test suite id using Azure DevOps API
我正在嘗試以下 API,以使用測試用例 ID 獲取套件 ID,
http://tfsb.xxx.com/xxx/xxxSoftware/_api/_testManagement/suites?testCaseId=185295&api-version=5.0
但我總是得到以下回應:
404 - 未找到文件或目錄。
您能告訴我如何使用 Azure DevOps 的測試用例 ID 獲取套件 ID 嗎?
這不是正確的 API,根據文檔,有一個特殊的 API - Get Suites By Test Case Id :
GET https://dev.azure.com/{organization}/_apis/test/suites?testCaseId={testCaseId}&api-version=5.0
整個上午都在為此掙扎。 終於想出了如何讓它工作。 你不應該在URL把項目/團隊名稱。 例如,大多數 API 調用如下所示:
https://dev.azure.com/{organization}/{project}/_apis/
但是,此api 調用的正確 URL 應如下所示:
https://dev.azure.com/{organization}/_apis/
換句話說,只放置基礎組織,而不放置項目/團隊。
如果您使用專用的組織 URL,則相同,而不是:
https://mycompany.visualstudio.com/Bigproject/_apis/
你必須做
https://mycompany.visualstudio.com/_apis/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.