0

I'm working on automating approvals of DevOps releases through another system. The problem is, I need to be able to identify which releases are on pipeline(s) built from a particular repository; I'm fine with having to make multiple API calls to get the right identifiers but I don't see any APIs where I can get information on the repository a pipeline is built on.

(Unfortunately my organization places multiple repositories per project so I can't do it with just the project specifier).

Is there some DevOps API I missed that I can get down to the level of info on which repository the pipeline uses?

Stephanie
  • 151
  • 8
  • 1
    Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue? – Vito Liu Apr 23 '21 at 09:16
  • Vito - apparently I did not get email notifications of answers on this. Thanks, your answer looks like it should work - I actually worked the same thing out myself. Will not have a chance to implement it until later but I'll come back and edit at the time. – Stephanie Apr 24 '21 at 21:22

1 Answers1

1

Create release pipeline and then we need to select the Artifacts, we could select Build or Azure Repo Git

enter image description here

If you are select Azure Repo Git

We could get the release repo info via this REST API Releases - Get Release and then search artifacts in the response body, then we could get the release repo info

GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=6.1-preview.8

Result:

enter image description here

If you are using Build as the artifact, we could get the build info, such as build ID, build definition ID and build definition name, check the pic below:

enter image description here

Then run this REST API Builds - Get to get the build detail info

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}?api-version=6.1-preview.6

enter image description here

And search repository in the response body to get the repo info

enter image description here

Vito Liu
  • 7,525
  • 1
  • 8
  • 17