title: Getting variables from a different file in Jenkins Pipeline
body: <p>I have a <code>contants.groovy</code> file as below</p>
  
  <pre><code>def testFilesList = 'test-package.xml'
  def testdataFilesList = 'TestData.xml'
  def gitId = '9ddfsfc4-fdfdf-sdsd-bd18-fgdgdgdf'
  </code></pre>
  
  <p>I have another groovy file that will be called in Jenkins pipeline job</p>
  
  <pre><code>def constants
  node ('auto111') {
    stage("First Stage") {
      container('alpine') {
        script {
          constants = evaluate readTrusted('jenkins_pipeline/constants.groovy')
          def gitCredentialsId = constants."${gitId}"
        }
      }
    }
  }
  </code></pre>
  
  <p>But <code>constants."${gitId}"</code> is says "cannot get gitID from null object". How do I get it?</p>