How do I pass username of the triggering user to my build script?


I've set up a "ReleaseCandidate" build, triggered only by "Run" (doesn't poll a repository) that labels a project before it builds, and sends an email notification afterward. It would be useful to include in the email the name of the TeamCity user who triggered the build. I don't see "username" in the list of predefined properties. Is there perhaps an undocumented property I could use, or some trick to get hold of the username who hit the "Run" button?

-chris walquist

Comment actions Permalink


I'm afraid there is no such property :(.
We have related request for this, please watch/vote for it:
Persist information about what triggered a build


Comment actions Permalink

Looks like this plugin will do the job.  Thanks Yegor!

BTW: In order to access the property, you have to reference it with a user-defined agent property.  Go to the "Properties and Environment Variables" tab and add a property with whatever name you want, and the value %build.triggeredBy.username%

See for my journey to this joy.


Please sign in to leave a comment.