Is there any way to remotely build a job using the REST API and to add a custom header in the request? Before the build starts to verify this header and to continue or fail the build according to the value of the header?
Build Parameter support are explained. The endpoint requires authentication and, if enabled, the CSRF token. Therefore, I am not sure what other problem you are trying to solve.
You can pass the authentication parameter using the curl's `--user` argument instead of embedding it into the URL, e.g. `--user developer:apiToken` or `--user developer` to get a password prompt see curl documentation for more details.
The thing is that, I need to trigger a build using the remote access API but, before starting the build, I need to verify that one of the parameters is the needed one and its value matches what I need. If not, I don't want to trigger the build. Is there a way to achieve this? Can I achieve this somehow configuring and/or defining parameters?
Comments
8 comments
Very helpful. Thx.
Hi,
Is there any way to remotely build a job using the REST API and to add a custom header in the request? Before the build starts to verify this header and to continue or fail the build according to the value of the header?
Thanks
Hi Miruna,
What are you trying to achieve by this?
Build Parameter support are explained. The endpoint requires authentication and, if enabled, the CSRF token. Therefore, I am not sure what other problem you are trying to solve.
Hi,
this works fine when we use plain (Without @, _, .) username.
When use email id as username, it is not working
any suggestions?
You can pass the authentication parameter using the curl's `--user` argument instead of embedding it into the URL, e.g. `--user developer:apiToken` or `--user developer` to get a password prompt see curl documentation for more details.
How can I trigger a release build of a project, using cURL approach?
I'm trying to achieve the same as Miruna.
The thing is that, I need to trigger a build using the remote access API but, before starting the build, I need to verify that one of the parameters is the needed one and its value matches what I need. If not, I don't want to trigger the build. Is there a way to achieve this? Can I achieve this somehow configuring and/or defining parameters?
The Generic Webhook Trigger Plugin can parse any JSON and contribute variables from it to the build.
Please sign in to leave a comment.