Release Note Templates are giving me a hard time

Using Octopus 2020.2.13 with Azure DevOps Services

I have the build information going to Octopus successfully as I can see the build info in the release.

I can also see the build info via the library

I have this as the release notes template for the project

Work Items
#{each workItem in Octopus.Release.WorkItems}

#{each commit in Octopus.Release.Commits}

But when the release is created (after the build info is pushed to Octopus), this is what I see

What am I missing?

Hi @dougbloch,

It looks like your Work Items are empty. If your build information is set up correctly you will have data in that section like here:

This indicates that the work items arent being linked correctly. Which Issue tracker are you currently using? Here is a link to our documentation on supported issue trackers.

It also looks like you will need to change your syntax in your release note template a little bit. Here is the section that we want to utilize: Documentation Link

For commits you will want to do something like

#{each package in Octopus.Release.Package}
- #{package.PackageId} #{package.Version}
#{each commit in package.Commits}
    - [#{commit.CommitId}](#{commit.LinkUrl}) - #{commit.Comment}

You can also reference the workitems within the same data structure with something like this:

#{each package in Octopus.Release.Package}
- #{package.PackageId} #{package.Version}
#{each workitem in package.WorkItems}
    - [#{workitem.Id}](#{workitem.LinkUrl}) - #{workitem.Description}

Please let me know if you have any other questions or if this works for you.



The example I provided doesn’t have workitems associated to the build, only commits, as that is the way it was checked in.

The syntax samples you provided are based on packages, and I’m not wanting the workitems/commits broken down by package as the workitems/commits me be duplicated and confuse QA.

I’m wanting to use the “distinct” list as in the same document link you provided.

This seems to be where the issue is.

Hi Doug,

Commits will not work with your syntax as Octopus.Release.Commits is not a valid system variable. The only way to reference the commits is to access it via Octopus.Release.Package. Package in this context is a data structure that houses WorkItems and Commits.My above logic will cycle through each package within the release and output the relevant information for each package.

In your case it should output:
C43166 - Removed connection string in transform files

If you simply want the commit Id and comment, you could remove this line - #{package.PackageId} #{package.Version} from the logic.

I’m sorry, I’m not fully understanding what you are wanting to do with the WorkItems. Does any package in the release have WorkItems? Could you please explain in greater detail what your setup is and which data you are trying to output into the release notes?


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.