What makes Credential Parameter special that it can be used in Bind area?

18 views
Skip to first unread message

Michael Carter

unread,
Aug 20, 2020, 5:29:11 PM8/20/20
to Jenkins Developers
Was designing my own "Credential Parameter" (basically a clone of the existing one with some extra on screen filtering) and it wasn't working... kept getting:

ERROR: Could not find credentials entry with ID '${Testing}'

In trying to trace the problem... if I use a String parameter.  I get the same error.  So my question what makes the "Credential Parameter" special that you can use it's ${name} in the  freestyle jobs Bind area for pulling passwords to variables?

Matt Sicker

unread,
Aug 21, 2020, 11:38:21 AM8/21/20
to jenkin...@googlegroups.com
As long as the UI in question is calling
CredentialsProvider.findCredentialsById(), that will automatically
parse the ${} syntax and replace them with parameter values. At a
super low level, this works via the following invisible action
attached to the build:
https://github.com/jenkinsci/credentials-plugin/blob/master/docs/consumer.adoc#binding-user-supplied-credentials-parameters-to-builds
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/31918aae-5e4e-46c8-ae39-6e80363d37a3n%40googlegroups.com.



--
Matt Sicker
Senior Software Engineer, CloudBees

Matt Sicker

unread,
Aug 21, 2020, 11:39:17 AM8/21/20
to jenkin...@googlegroups.com

Michael Carter

unread,
Aug 21, 2020, 1:23:27 PM8/21/20
to Jenkins Developers
Thanks that got me to where I needed to be.  my solution was a fresh class modelled after CredentialsParameterValue... didn't realize there was a step actually looking for the CredentialsParameterValue class.   So now I'm extending it and heavily overriding everything.  My solution is working now.

Thanks again.
Michael

Reply all
Reply to author
Forward
0 new messages