question

VeereshGendleMaqLLC-4852 avatar image
0 Votes"
VeereshGendleMaqLLC-4852 asked ·

Is there a way to list pull request files(from source branch) with it's location in Azure Devops using APIs? Is there any other way using C#?

Requirement is to read/extract source code of each file present in an Azure DevOps pull request using APIs or C#. I am able to download the code for a particular file using sample URL below -

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/items?path=/{CodePath}&version={branch name}&api-version=5.1

Now I need, list of files with location where it is stored in a branch of Azure DevOps

I have tried different GET calls from REST APIs available. Ex - GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/iterations/{iterationId}?api-version=5.1 or GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/attachments/{fileName}?api-version=5.1-preview.1

These calls are returning information 1. About file commits 2. About documents attached in description

Information I have to fulfill the requirement - Organization name,Repository name,Branch Name, Pull request ID

Thanks in advance

not-supported-azure
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DSPatrick avatar image
0 Votes"
DSPatrick answered ·

They're actively answering Devops questions in dedicated forums here.


https://developercommunity.visualstudio.com/spaces/21/index.html


--please don't forget to Accept as answer if the reply is helpful--


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management


Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.