Export of discussion notes from Azure DevOps - azure-devops

Is there a way to export discussion notes from Azure DevOps Work items like Task/Bug etc. Or is there a way in Azure DevOps to get a consolidated web view of discussion? Or can you suggest any extensions that help achieve this?
Checked Azure DevOps for getting the dump through query which did not work

Using the rest api below, you can get the comments records of multiple work items from the response body.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems?ids={ids}&api-version=5.1
But the flaw of this rest api is that it can't display all the comment records, only display the latest comment of this work item.
If you want to get all the comments of a work item, you need to use the rest api below. However, the drawback of this rest api is that it can only return all the comments of a work item, and cannot display the comments records of multiple work items.
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workItems/{id}/comments?api-version=5.0-preview.2

Related

Is it possible to retrieve build definition ID related to a work item using Azure DevOps REST API?

The requirement is to fetch all the work items between different releases and create a report. The list of work items can be fetched using below API call.
https://vsrm.dev.azure.com/{organizationName}/{projectName}/_apis/release/releases/{currentReleaseId}/workitems??api-version=6.0&baseReleaseId={baseReleaseId}
Now, for each of this work item, we also need to know the build version when it is delivered. I'm not able to find any entries related to build/release in the work item data fetched using
https://dev.azure.com/{organizationName}/_apis/wit/workItems/{ID}
Is there any relationship between work item tasks and respective build or release definition ID when it was delivered?
Is it possible to retrieve build definition ID related to a work item using Azure DevOps REST API?
The answer is yes.
You could use the REST API Work Items - Get Work Item with $expand to get the commit links:
Get https://dev.azure.com/{org name}/{project name}/_apis/wit/workitems/{id}?$expand=relations&api-version=6.0
Then you would see the commits in relations part of the response body:
Then we could use the REST API Statuses API for Commit. It seems that when starting and ending build, the appropriate status is posted.
So when we call
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/statuses?api-version=6.0
We will get all last builds associated with the Commit and their statuses.

Can You Get Project Startdate from Azure DevOps REST API?

I'm trying to query the Azure Devops REST API to see when a project first came into existence and, perhaps, who created it. I'm using the link below and my results do match the documentation which, unfortunately, doesn't include create date. Is there any other ways to query AzDo REST API to get this data?
https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/get%20project%20properties?view=azure-devops-rest-5.1
I am afraid there is no rest api to get the start date of project. The start date property is not included in the returned results of Get Project Api.
This issue has been reported to Microsoft develop team. You can vote up this thread or submit a new feature(Click Suggest a feature and choose Azure Devops).

Azure Devops - How to get published information of a wiki page using Rest API

I referred this Microsoft document "MS Rest API documentation for wiki" and was able to get all the pages available in wiki. I was trying to get the published author and published time related information for which there is no available reference.
Is there any Azure DevOps Rest API available to get this information?
Azure Devops - How to get published information of a wiki page using Rest API
I am afraid there is no such REST API at this moment, however you can track it by tools such as Fiddler or press F12 in Chrome browser then select Network.
On the web UI, we could access the View revisions of the Wiki:
We could get the history of this Wiki:
Then we press F12 and click the first history, we could get the REST API like below:
https://dev.azure.com/<OrganizationName>/<ProjectName>/_apis/git/repositories/<WikiName>/Commits/<CommitsId>?
But, if we want to automate it by REST API, This seems impossible at the moment.
To automate it, we need to get the first commit ID for the Wiki, I could use the REST API:
https://dev.azure.com/<OrganizationName>/<ProjectName>/_apis/git/repositories/<WikiName>/Commits/?
Now, I could get the all the commits, but those commits for all Wiki files, and there are no other parameters that can be used to filter out which wiki document the commit is associated with. So, we could not get the first commit for each wiki automatically. That is the current limitation.
Hope this helps.
You can get commits from specific pages: searchCriteria.itemPath=
Here is doc:
https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits?view=azure-devops-rest-6.0
Wiki page path will be: /WikiName/Folder--Name/Page-Name.md
Keep in mind that space in page name or folder name you need to replace with '-'. Also add extension to the page '.md'

Get changes associated with a build in Azure Devops using REST API

In Azure Devops under the "Summary" tab associated with a build, there are a list of changes (Git hashes, etc.) associated with the build. I'm trying to figure out how to get these via the rest API.
I found this REST API to get the changes between the two builds.
It works if I have the previous build id in the pipeline, however in the situation I'm interested in, I have the current build id, I need to somehow use the REST API to find the previous id.
Is there a way to do this using the REST API, or a better way to accomplish what I'm trying to do here?
As far as I can see, there's a special REST API call for that. You pass the buildId as a part of the URL and get the collection of changes (Change[]) in response.

Get the team backlog using TFS REST API

Is there a REST API I can call to retrieve the backlog (as in "the list of work items on the backlog") for a particular team in TFS?
I have found that TFS uses a private API to retrieve the content, but I am not particularly confortable using it since it is not documented.
Btw, the private API in question is
[project]/[team]/_api/_backlog/payload?__v=5&level=Stories&includeParents=false
I've tested this API on my side, it does get all information on Backlog site. Although it is not documented, you can use it to get information you want.