Pikolo
Pikolo

Reputation: 99

How to trigger Jenkins builds remotely using URL with parameters

I'm trying to trigger build in Jenkins remotely using URL. the URL is : "http://myJenkinsURL/job/myProjectName/build?token=SOME_TOKEN&EXTID=lkjsdfljsdflkjsdfjklsdflkj"

The problem is when i try to trigger this build it redirect me to my Jenkins and ask me to insert the parameter but i already passed it over the URL.

Is there something that I'm missing in the process?

Upvotes: 3

Views: 14146

Answers (1)

burnettk
burnettk

Reputation: 14037

https://wiki.jenkins.io/display/JENKINS/Parameterized+Build has the gory, but it mentions that you want a URL like this (note buildWithParameters):

http://server/job/myjob/buildWithParameters?token=TOKEN&PARAMETER=Value

so your call might look like this:

curl -X POST "http://myJenkinsURL/job/myProjectName/buildWithParameters?token=SOME_TOKEN&EXTID=lkjsdfljsdflkjsdfjklsdflkj"

Upvotes: 9

Related Questions