Jenkins Remote Trigger Not Working Jenkins Remote Trigger Not Working curl curl

Jenkins Remote Trigger Not Working


I install Build Token Root Plugin to solve this issue before

https://wiki.jenkins-ci.org/display/JENKINS/Build+Token+Root+Plugin

Then as the same, setup Authentication Token

Finally, either use curl to trigger remote build (Be careful the escape character "\")

curl http://JENKINS_URL/buildByToken/build?job=JOB_NAME\&token=TOKEN_NAME

or paste the URL to your browser (No needs escape character "\")

http://JENKINS_URL/buildByToken/build?job=JOB_NAME&token=TOKEN_NAME

If you see Succeed, it means that trigger remote Jenkins successfully.

Note that, you don't have to setup build, discover, and read rights on Job

For more information, you could reference to https://cloudbees.zendesk.com/hc/en-us/articles/204338790-Why-are-builds-not-being-triggered-with-Build-Token-Root-Plugin-


I think there's no need to set up any kind of plugin to make it works, simply do this BATCH CMD:

curl -X POST http://USER_ID_JENKINS_RECEIVER:TOKEN_OF_USER_ID_JENKINS_RECEIVER@URL_JENKINS_RECEIVER:PORT/job/NAME_OF_JOB/buildWithParameters?token=TOKEN_JOB_JENKINS_RECEIVER
  • To see you USER_ID_TOKEN, go to your username at the top-right of jenkins > go to Configure > Click on API Token and it will be displayed.

  • You must configure a token on the JOB_OF_JENKINS_RECEIVER

I have to say that it works perfectly on Jenkins without any kind of permissions to anonymous users.


I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:

curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>

Use the same username and password you use to login to Jenkins. There was no need to install additional plugins.