Не удалось получить сведения о проекте как часть запроса API определения конвейера выпуска - PullRequest
0 голосов
/ 14 июля 2020

В качестве части ответа API определения конвейера выпуска ниже я не могу получить сведения о текущем проекте. "ProjectReference" каждый раз возвращается как null. Может ли кто-нибудь помочь мне, если мне что-то здесь не хватает.

https://docs.microsoft.com/en-us/rest/api/azure/devops/release/definitions/list?view=azure-devops-rest-5.1

1 Ответ

0 голосов
/ 15 июля 2020

Из документа api мы видим, что «projectReference» содержит информацию об идентификаторе и имени проекта

enter image description here

If you want to get the project information where the release pipeline is located, you can get the project name from the request url and the project id in the "url" parameter.

GET https://vsrm.dev.azure.com/{organization}/{projectName}/_apis/release/definitions?api-version=5.1

enter image description here

If you want to get the project information of the artifact source in the release pipeline, you need to add $expand=Artifacts to the request url , so you will get the project id and name of the artifact.

GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?$expand=Artifacts&api-version=5.1

введите описание изображения здесь

...