I am using SendGrid email extension to trigger a custom email notification after the CI/CD process is complete in VSTS. This email task has HTML content in it which includes some content fetched using standard build/release variables (https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/build/variables?tabs=batch).
How do I include associated code changes, check-in comments and linked work items for a particular release in the custom email? Are there any variables I can use? Any work around?
Click the Repositories and the Branches Menu in the Azure DevOps Portal . Locate in the branch list the one you are going to use to build from, typically that should be your master branch, and click the options icon. Select Branch policies. Check the option ”Check for linked work items”.
To find a changeset from the command prompt, enter tf changeset . For more information, see Changeset command.
Choose the files you want to check inIn Solution Explorer, right-click the solution, one or more code projects, or one or more files, and select Check In. In Source Control Explorer, select one or more items with pending changes, or one or more folders that contain items with pending changes.
Open a work item and choose the Links tab. From the links control tab you can link to new or existing work items, open the linked object, edit the link type, delete a link, or open the list of links in a query or Excel or Project. The work item form opens in the web portal for Visual Studio 2017 and later versions.
There aren’t the built-in variables that can get code changes, check-in comments and linked work items.
You can get them through REST API during build or release:
Build.BuildId
during build or Release.Artifacts.{Artifact alias}.BuildId
during release) Note: using Build.SourceVersion
to get latest version)No API to get detail code changes, but you may refer to this related issue: Lines of Code modified in each Commit in TFS rest api. How do i get?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With