DEV Community

Cover image for Generate Releases Notes easily

Generate Releases Notes easily

antoinega profile image Antoine Updated on ・3 min read

Photo by Aaron Burden on Unsplash

I came on this post about using 2 tasks to generate release notes on Azure DevOps, and just want to share it with you.

Generate Notes in Build

You can easily add the task Generate Release Notes (Crossplatform) to your build and use the template suggested by the author, as inline template.

# Notes for build 
**Build Number**: {{}}
**Build Trigger PR Number**: {{lookup buildDetails.triggerInfo 'pr.number'}} 

# Associated Pull Requests ({{pullRequests.length}})
{{#forEach pullRequests}}
{{#if isFirst}}### Associated Pull Requests (only shown if  PR) {{/if}}
*  **PR {{}}**  {{this.title}}

# Builds with associated WI/CS ({{builds.length}})
{{#forEach builds}}
{{#if isFirst}}## Builds {{/if}}
##  Build {{}}
{{#forEach this.commits}}
{{#if isFirst}}### Commits {{/if}}
- CS {{}}
{{#forEach this.workitems}}
{{#if isFirst}}### Workitems {{/if}}
- WI {{}}

# Global list of WI ({{workItems.length}})
{{#forEach workItems}}
{{#if isFirst}}## Associated Work Items (only shown if  WI) {{/if}}
*  **{{}}**  {{lookup this.fields 'System.Title'}}
  - **WIT** {{lookup this.fields 'System.WorkItemType'}} 
  - **Tags** {{lookup this.fields 'System.Tags'}}

{{#forEach commits}}
{{#if isFirst}}### Associated commits{{/if}}
* ** ID{{}}** 
  -  **Message:** {{this.message}}
  -  **Commited by:** {{}} 
  -  **FileCount:** {{this.changes.length}} 
{{#forEach this.changes}}
      -  **File path (TFVC or TfsGit):** {{this.item.path}}  
      -  **File filename (GitHub):** {{this.filename}}  

It will generate a file to $(Build.ArtifactStagingDirectory)/ and you can publish it using the Publish task.

Generate Notes in Release

Like in the previous section, we can use the same tasks to generate the release notes.
But we want to aggregate it.

The task Git based WIKI Single File Updater from Black Marble is also available to update Azure DevOps Wiki with file. Let's use it !

We need to fill a lot of information.


  • Wiki repository

Go to the Wiki.
By clicking on the 3 dots in the Azure DevOps Wiki, you will be able to clone the Repository and get its url.

Get the clone button

  • Branch

Just use the default branch (master) and leave the branch empty.

  • Page name

For the name of the page, you can leverage predefined variables in Azure DevOps to generate one different page each time.

For example : $(Release.DeploymentName)-$(Release.DeploymentID).md


Fill an explicit Git Name and Git Email as the will be written to track the update of your wiki.

Azure DevOps credentials

I recommend to create a variable group to store your username and the Personal Access Token used for authentication. It will be easier for you to track and reuse them, if needed.

Go create a variable group, and add both username and Personal Authentication Token as secrets.

To generate the Personal Access Token:

  • click on User Settings
  • click on Personal access tokens
  • click on New Token
  • Grant only Read & Write authorization
  • Copy the token in the secret variable

Troubleshooting page in case of issues.

Hope this helps !


Editor guide