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}
#{/each}
#{/each}
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}
#{/each}
#{/each}
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.
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:
Arthrex.Creekside.ProductAssigner 3.15.0.5
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?