Quantcast

Accessing query string parameters in the UI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Accessing query string parameters in the UI

James Davis
Hello,

I am building a jenkins job using curl and want to pass a custom
parameter each time, e.g. curl http://localhost:8080/jenkins/job/param/build?delay=0sec&qa=test.

How do I access the query string parameter qa? I have tried ${qa} and $
{env.qa} but it does not work. I am passing the query string parameter
in an attempt to dynamically pass ant a system variable.

Help!! I tried searching google but got lost in the results.

Sincerely,

James Davis
Bap
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing query string parameters in the UI

Bap
Quoting James Davis <[hidden email]>:

> Hello,
>
> I am building a jenkins job using curl and want to pass a custom
> parameter each time, e.g. curl  
> http://localhost:8080/jenkins/job/param/build?delay=0sec&qa=test.
>
> How do I access the query string parameter qa? I have tried ${qa} and $
> {env.qa} but it does not work. I am passing the query string parameter
> in an attempt to dynamically pass ant a system variable.
>
> Help!! I tried searching google but got lost in the results.
>
> Sincerely,
>
> James Davis

https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Accessing query string parameters in the UI

James Davis
Bap thank you for pointing me in the right direction. All set now.

I was doing two things wrong. My first mistake was the jenkins slave
is running on is windows but build property was in linux format, e.g.
my.prop=$BAR instead of my.prop=%BAR%. The second mistake was I had
the delay parameter in front of the one I was trying to pass, e.g.

curl http://localhost:8080/jenkins/view/TEST/job/lejob/buildWithParameters?delay=60sec&myQuery=BTF

instead of

curl http://localhost:8080/jenkins/view/TEST/job/lejob/buildWithParameters?myQuery=BTF&delay=60sec.

I am not sure whether if the second point is a false positive or not.
The test seems to start regardless of the value of the delay
parameter. Anyways thanks again,

Sincerely,

James Davis

On Nov 18, 2:41 pm, Bap <[hidden email]> wrote:

> Quoting James Davis <[hidden email]>:
>
> > Hello,
>
> > I am building a jenkins job using curl and want to pass a custom
> > parameter each time, e.g. curl
> >http://localhost:8080/jenkins/job/param/build?delay=0sec&qa=test.
>
> > How do I access the query string parameter qa? I have tried ${qa} and $
> > {env.qa} but it does not work. I am passing the query string parameter
> > in an attempt to dynamically pass ant a system variable.
>
> > Help!! I tried searching google but got lost in the results.
>
> > Sincerely,
>
> > James Davis
>
> https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build
Loading...