How to trigger Jenkins build with parameters from Gitlab webhook?

I have GitLab Community Edition 8.15.2 successfully trigger pipeline projects in Jenkins 2.32.1 using a webhook (but without any parameters). I want the gitlab push to trigger a build with parameters but the parameter value is null when it comes through so the build fails.

The gitlab webhook looks like:

http://jenkins.server:8080/project/project-a/buildWithParameters?MYPARAM=foo

In my pipeline project I echo the parameter value out with

echo "MYPARAM: ${MYPARAM}"

and it’s not set to anything. Any ideas on where I’ve gone wrong?

3 Likes

Hello There. Did you find any solution for your problem? I’m having the same issue here.