- 
    
Bug
 - 
    Resolution: Duplicate
 - 
    
Minor
 - 
    None
 
I tried using string parameter with declarative where user types in their user store credential id but then declarative 'credentials' DSL failed to find it. Below is sample script where 'my-user-cred' is credential id created in user credentials store.
 
pipeline{
  agent any
  environment { 
    USER_CRED = credentials('my-user-cred') 
  }
  stages {
    stage('Example') {
      steps {
        sh 'echo ${USER_CRED}'
      }
    }
  }
}
 
 It fails with:
org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: my-user-cred at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler.forId(CredentialsBindingHandler.java:121) at org.jenkinsci.plugins.pipeline.modeldefinition.model.CredentialsBindingHandler$forId.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18) at
- duplicates
 - 
                    
JENKINS-44772 User Scoped credentials are not used by the "withCredentials" pipeline step
-         
 - Open
 
 -