How to pass message to notifier

Completed

One of my build steps uploads the artifacts to my public static server and gives a URL to the download link. I want that the URL is embedded into the email notification when a build is successful. Is there any place where I can save values to and access it in the notification template?

3 comments
Comment actions Permalink

Hi,

You can pass a message via a parameter fairly easily. Edit a notification template and add the following line to both <#global body> and <#global bodyHtml> sections of the template:

${build.parametersProvider.all["you.parameter.name"]}

You can assign your parameter a new value right during the build using a service message like this:

##teamcity[setParameter name='you.parameter.name' value='http://server/artifact.file']
0
Comment actions Permalink

That's what I am looking for! But one more concern: Does the "service message" only modify the parameter for the build that sending this message? Say that I have triggered 2 builds and if they can be run in parallel, will they modify their own parameter respectively?

0
Comment actions Permalink

You can access the value of a dependency build parameter from a dependent build by using a dependency property reference. For example:

Configuration C2 depends on the configuration C1.
C1 has a parameter named "your.parameter.name".
You can access its value from C2 by creating the following parameter in C2:

your.other.parameter=%dep.C1's_ID.your.parameter.name%
0

Please sign in to leave a comment.