I specified UserCause instead of RemoteCause and it still says:
Started by remote host xx.xx.xx.xx
Script returned: []
=================================================
import hudson.model.*
build.getCauses().grep(hudson.model.Cause.UserCause).each {
def findcause = it.getUserName()
println findcause
}
=================================================
Thanks,
Mandy
On Tuesday, July 28, 2015 at 5:51:07 PM UTC-7, Christopher Orr wrote:
>
> Are you not seeing the information you need in the causes? What are you
> seeing instead?
>
>
> On 29/07/15 01:18, Mandy wrote:
> > Anyone?
> >
> >
> > On Friday, July 24, 2015 at 2:00:52 PM UTC-7, Mandy wrote:
> >
> > The build is not being started by the logged in user. It is started
> > by another user on a remote machine using some other account
> > credentials on command line. It looks like following
> >
> > User test1 is looged into Jenkins
> > User test2 is logged into some remote machine and specifies
> > "testuser" credentials in command line.
> >
> >
> >
> >
> > On Friday, July 24, 2015 at 1:36:28 PM UTC-7, Christopher Orr wrote:
> >
> > On 24/07/15 22:23, Mandy wrote:
> > > I have active directory authentication on Jenkins and I am
> > launching job
> > > remotely using the following command line
> > >
> > > curl -u testuser:7658756hfjsdngsd8908593486
> > > http://jenkinsserver:8080/job/testjob/build?token=onlytest
> > >
> > > How can I using groovy get access to this username in the
> job?
> >
> > The solution is essentially the same as your last question about
> > getting
> > the IP address of a user starting a job.
> >
> > If the user was started by a logged-in user, the "cause" of the
> > build
> > will be UserCause, rather than RemoteCause:
> >
> >
> https://github.com/jenkinsci/jenkins/blob/ed2988f/core/src/main/java/hudson/model/Cause.java#L374-L376
>
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Jenkins Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to [email protected] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/jenkinsci-users/fb0514f8-14cb-4781-a134-2d121e7fc43b%40googlegroups.com
>
> > <
> https://groups.google.com/d/msgid/jenkinsci-users/fb0514f8-14cb-4781-a134-2d121e7fc43b%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/85b546b1-a33c-416e-8d8d-eae4aa6b2af5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.