title: Jenkins Job DSL:I want to get branch with commit or tag
body: <p>Following my title.</p>
  
  <p>I use the groovy to do that.</p>
  
  <p>But it doesn't work. who can ask me how do it?</p>
  
  <p>the following is my source:</p>
  
  <pre><code>job("AAA") {
  parameters {
    stringParam('branch_name', 'master', 'input branch name')
    stringParam('commit_id', '123456', 'input commit id')
  }
  gitSCM {
    userRemoteConfigs {
     userRemoteConfig {
      url("ssh://git@abc/abc.git")
      name("${branch_name}")
      }
    }
    branches {
      branchSpec {
        name("${commit_id}")
      }
    }}
  </code></pre>
  
  <p>Thanks.</p>