Search code examples
jenkinsrest-assuredjenkins-api

How to pass multiple build parameter value for a Jenkins job using Rest Assured?


I want to remotely build a jenkins job using multiple parameter through restassured API jobs in java. I tried using the following link

http://localhost:8080/job/jobname/buildWithParameters?token=TOKEN&FEATURE="parameter1_value";FEATURE2=parameter2_value

but this url results in triggering a job with passing both the parameter values within a single parameter.

get("http://localhost:8080/job/jobname/buildWithParameters?token=TOKEN&FEATURE="parameter1_value";FEATURE2=parameter2_value");

This is how the above link results in

This is the response json of jenkins job

This is the response json on jenkins job


Solution

  • The parameter defined in configuration of a Jenkins job should be a "String Parameter" in order to set them using URL. And the modified URL should be like -

    http://localhost:8080/job/jobname/buildWithParameters?parameter=parameter1_value&parameter2=parameter2_value