title: Clone from bitbucket private repository using jenkins Pipeline as code
body: <p>im using jenikins pipeline as code to clone a git project which is in private bitbucket repository(stash repository). i used this code block to clone the project in my pipeline script.</p>
  
  <pre><code>node {  
  //checkout from master  
  stage 'checkout'  
     withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyID', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD']]) {  
  
        git url: 'https://paulrda@devMyCompany.org/stash/scm/test_automation.git' , branch: 'development'   
     }  
  }  
  </code></pre>
  
  <p>'MyID' is the credential ID and my username and password is correct.i save my credentials in global credentials feature in jenkins. but i get this error when i build the jenkins task.</p>
  
  <pre>
  ERROR: Error fetching remote repo 'origin'
  hudson.plugins.git.GitException: Failed to fetch from https://paulrda@devMyCompany.org/stash/scm/test_automation.git
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate(ACL.java:221)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://paulrda@devMyCompany.org/stash/scm/test_automation.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
  stdout: 
  stderr: fatal: Authentication failed for 'https://paulrda@devMyCompany.org/stash/scm/test_automation.git/'
  
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
      at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
  
  </pre>
  
  <p>In my mac machine under my paulrda account i can successfully clone my project using jenkins pipeline script but when i change to another account and run jenkins i get this error. still i cant understand why i get this error. please provide a solution to this problem. </p>
  
  <p>my configurations.<br>
  Jenkins version : 2.19.2<br>
  Credentials Plugin : 2.1.8<br>
  Git plugin : 3.0.0<br>
  Git client plugin : 2.1.0</p>