0

My team and I are trying to find a way to automatically build release notes and generate them in markdown to be put into a Wiki for users to access. I found a video from Microsoft where their team uses a process where they have release notes for each feature in their Feature objects, but they have manually query those objects and build a markdown file for each release manually. I'm sure by now they must have figured this out, but can't find anything from them yet on that.

Now, I have seen a couple of market place tools (Bravo Notes for one) that do this, but I figured there must be a way we can make a task ourselves that does this for us and automatically place the markdown file in our Wiki (after an approval process of course).

If anyone has any ideas on how I can accomplish this, please let me know. I'm not afraid of getting my hands dirty with some Powershell scripts.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
David Coxsey
  • 53
  • 1
  • 5

1 Answers1

0

You can use Azure DevOps Rest API to get the work item that associated to the build, then get work item details. create from the details a Markdown file and add it to the wiki.

Example to PowerShell script that do it (get work items asscoited with the build and print the AssignedTo field):

$user = ""
$token = "MY-PAT"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
$url = "https://dev.azure.com/{org}/{project}/_apis/build/builds/{buildId}/workitems?api-version=5.1"
$workItems = Invoke-RestMethod -Uri $url -Method Get -ContentType application/json -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
$json = $workItems | ConvertTo-Json


$workItems.value.ForEach({
     $workItem = Invoke-RestMethod -Uri $_.url -Method Get -ContentType application/json -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
     Write-Host $workItem.fields.'System.AssignedTo'.displayName
})
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
  • That may actually work better, since we could just have our internal site just call that API to build dynamic release notes. – David Coxsey Aug 16 '19 at 13:17
  • what values need to go into the $user and $token variables? I tried my azure DevOps user name and copied my PAT, but that doesn't seem to work. What am I missing? – David Coxsey Aug 19 '19 at 20:28
  • The $user should be empty string, the $token should be your PAT, which error do you get? – Shayki Abramczyk Aug 19 '19 at 20:59