I’m in the process of converting some jobs to declarative pipeline (scm stored) and I can’t find a way to express the ‘Trigger builds remotely’ in the UI into a declarative pipeline directive, as the default ‘triggers’ section doesn’t seem to expose anything helpful.
The only way I found was to rely on the generic webhook plugin, but I’d rather avoid depending on a new plugin that isn’t even required for basic UI configuration.
Is there a native way to express token triggers in declarative pipeline that I missed ?
The approach to start builds via such tokens is deprecated since long time (The javaday says 2008).
The implementation is not exposed as an extension which makes it impossible to reference it in a pipeline.
The better approach is to grant a technical user (which you probably need anyway to access Jenkins) the build permission on the job.
Thanks for the info, that was quite informative.
I re-read the official documentationfor remote access, and indeed this kind of token isn’t mentioned anymore.
A token is still needed though, but it’s a user-token used as a password for the basicauth when performing the web call.
Now I need to modify all my tools to use the ‘new’ way of remoting before I can switch properly to declarative pipeline