Status: Open (View Workflow)
When using the Parameter Expression option, it's unclear what the expression needs to resolve to. After some guessing, I figured out it likes credentials IDs. First, the fact that I had to figure this out by trial and error is annoying (it's undocumented AFAICT).
Second, it would be nice if you could search by name/description. Otherwise, for this parameter to be used, I have to maintain a table of name to ID mappings somewhere in the job's parameters, and that's fragile and redundant.
- relates to
JENKINS-45378 withCredentials referencing an undefined credentialsId should fail with a more human readable error
Ought to be shown without an Advanced block. Domains restrict applicability for example in the UI but IDs must still be globally unique.
I have been looking for the same thing, and what I found is that the reason for closing
JENKINS-36470 makes this one closable also.
Or maybe that is just too much security reasons?
As of https://github.com/jenkinsci/credentials-plugin/commit/e2bf9d867926d1c3b1247122901cf2287ef7416b the ID is displayed without an Advanced block.
JENKINS-45378 tracks improvements to diagnostic message. Perhaps this is a duplicate.
Sigh. If I can only query by ID, why hide it in advanced? Why have a name and a description field if you can only reference ID? Is the ID namespace global or per domain? If global, what's the point of a domain? /rant
So my real problem comes down to the error message. After some testing, I found that it is the same (like above) in both the case where CREDS_ID is undefined and when it is defined but invalid. In the invalid case, it doesn't tell me what CREDS_ID is, which lead me to believe it wasn't being subbed correctly.