title: passing items in two lists simultaneoulsy in each loop Jenkinsfile
body: <p>I have a list <code>foo = ['tea',''sugar','milk']</code> and <code>col = ['black','white','pink']</code> what I am trying to do is nested loop</p>
  
  <pre><code>def foo = ['tea','sugar','milk']
  def col = ['black','white','pink']
  
  [foo, col].transpose().each { x, y -&gt;
     sh """aws deploy push --application-name "${x}" --source "${y}" """
  }
  </code></pre>
  
  <p>Desired Result </p>
  
  <pre><code>--application-name "tea" --source "black" 
  --application-name "sugar" --source "white" 
  --application-name "milk" --source "pink"
  </code></pre>
  
  <p>the result I am getting </p>
  
  <pre><code>[Pipeline] script
  [Pipeline] {
  [Pipeline] echo
  --application-name "[tea, black]" --source "null" 
  [Pipeline] echo
  --application-name "[sugar, white]" --source "null" 
  [Pipeline] echo
  --application-name "[milk, pink]" --source "null" 
  [Pipeline] }
  [Pipeline] // script
  [Pipeline] }
  </code></pre>
  
  <p>I want the list items in <strong>foo</strong> and <strong>col</strong> to be injected one by one  to the above shell script
  Is there a way where we can pass both list items at once to the above shell script</p>
  
  <p>Ref <a href="https://stackoverflow.com/questions/28207649/nested-each-loops-in-groovy">Nested `each` loops in Groovy</a></p>
  
  <p>Can we do something like <code>(foo,col).each</code> </p>
  
  <p>or maybe using for loop <code>for(x in foo &amp;&amp; y in col)</code></p>
  
  <p>Ref my Jenkinsfile</p>
  
  <pre><code>pipeline {
  agent any
  stages {
      stage('hello'){
          steps{
          script{ 
          def foo = ['tea','sugar','milk']
          def col = ['black','white','pink']
  
          [foo, col].transpose().each { x, y -&gt;
          sh """aws deploy push --application-name "${x}" --source "${y}" """
          //echo """--application-name \"${x}\" --source \"${y}\" """
          }
        }
      }
  }      
  </code></pre>
  
  <p>}
  }</p>