I want list of the workItems that is changed after build in excel file.
So far I am here :
$AzureDevOpsPAT = "**********************************"
$fromBuildId = "161"
$toBuildId = "176"
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) }
$uriAccount ="https://AzureDevOpsServerName/DefaultCollection/ProjectName/_apis/build/workitems?fromBuildId=$($fromBuildId)&toBuildId=$($toBuildId)&api-version=5.0"
$responsewe = Invoke-RestMethod -Uri $uriAccount -Method Get -Headers $AzureDevOpsAuthenicationHeader
$d1 = $responsewe.value | ConvertTo-Json write-host $d1
write-host $d1
Also, How can I generate release notes from these workItems ?
I am new in Powershell and DevOps too, So, any idea will be appreciated.
I have tried to Get-list of list workItems first.
2
Answers
You can use below Powershell command to get the output of WorkItems between builds in csv file:-
Output:-
Reference:-
Builds – Get Work Items Between Builds – REST API (Azure DevOps Build) | Microsoft Learn
You have used correct rest api to get the work items between builds. Now you need to export the work items to the excel, and generate release notes.
what information
from each work item you want to include in the release notes. Once you’ve decided that, you can loop through each work item and extract the necessary information.The whole script sample: