How do I pass username of the triggering user to my build script?
Hi,
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?
Thanks!
-chris walquist
Please sign in to leave a comment.
Chris,
I'm afraid there is no such property :(.
We have related request for this, please watch/vote for it:
http://www.jetbrains.net/jira/browse/TW-399
Persist information about what triggered a build
Thanks,
KIR
Looks like this plugin will do the job. Thanks Yegor! http://www.jetbrains.net/confluence/display/TW/Groovy+plug
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 http://jetbrains.net/tracker/issue/TW-9088 for my journey to this joy.