Start Job HTTP API parameters
Is it possible to start a Job via the HTTP API and pass arguments that can be used in the job?
The Start Job HTTP API endpoint (POST /api/http/projects/{project}/automation/jobs/{jobId}/start) has an "parameters" argument.
However when that argument is specified the endpoint always returns the following error:
Following parameters are not defined in the list of the Job parameters and can't be passed for running the Job: example
How can I define Job parameters to allow via the HTTP API?
Please sign in to leave a comment.
Hi Florian,
Sure, here's an example of the request body:
Please feel free to use our HTTP API Playground in Space UI to prepare a request with all necessary parameters in a more handy way.
Hello,
Thank you for the reply.
I tried using the API Playground but without luck.
I tried starting this job
using this request body
but got the following error as response:
Florian - hi,
Could you please confirm that you have this parameter with the name `test` set up for the same project where you use it in the automation job (https://www.jetbrains.com/help/space/secrets-and-parameters.html)?
Looking forward to hearing from you!
Hi,
the parameter is defined.
The job can be started using the REST API, when not specifying a value for "parameters" in the POST body.
That uses the parameter defined in the projects settings.
I would want to override the default parameter value by specifying it in the POST body if possible.
The "parameter" parameter is missing in the API reference: https://www.jetbrains.com/help/space/projects-a.html#start_job so I am not sure how to use that.
My goal is to specify arguments in the "Start job" API request and then use them in the job itself.
Hi,
I'm trying to do the same thing, but using the kotlin space API with the same result. I have defined the parameters in the project setting, but when I try to start the job using
I get the same error than Florian:
Juanluisrp - hi,
We've enabled the related feature flag for your organization. Now, in order to use parameter1 and parameter2, you need to add this section to the job dsl:
For more information please refer to https://youtrack.jetbrains.com/issue/SPACE-13318 to figure out how to use params for a job.
Please let us know if further assistance is needed.