I am using the post w build groovy plugin.
http://wiki.hudson-ci.org/display/HUDSON/Groovy+Postbuild+Plugin
I would like to access the name of the user who started the assembly. What is the correct variable for this?
I run something like this:
def build = manager.build // "manager" for Groovy Postbuild plugin, only def usercause=build.getCause(hudson.model.Cause$UserCause) def thename=usercause.userName
Looking at Javadocs for a variable build, there is a method getCauses(). I think you can start there.
build
getCauses()
https://hudson.dev.java.net/nonav/javadoc/hudson/model/Run.html#getCauses ()
causes, , . SCM, .
causes
jenkins 1.561
def userName = manager.build.getCause (hudson.model.Cause $ UserIdCause) .userName
Source: https://habr.com/ru/post/1769552/More articles:Могу ли я переоценить (скачаю акулу, если можно так выразиться) это приложение? - content-management-systemHex code for Control + Question Mark? - cgethitRect (), I am doing it wrong, how does it work? - androidConnecting to an Informix Database Using SQL Management Studio - informixИнтеграция селена с помощью Jmeter или Grinder - seleniumWhy am I getting extra line breaks on a webpage that I load using Perl? - windowsAhhhhh! Where did the form go? - formsReturn Values PLSql - stringEclipseLink / JPA: some @DiscriminatorColumn annotations for Entity - javaMaximum size in conjunction with previous Oracle - oracleAll Articles