Answers: <p>We have moved onto using Jenkins templates and I have a workaround to keep the individual approver names list in one place. Sharing the sample code for your reference.</p>
  
  <pre><code>#!/usr/bin/env groovy
  import com.mm.Constants 
  def call(String teamName = 'LOGIN') {
     // team name of null means UI
     teamName = teamName ?: 'UI'
  
     timeout(time:2, unit:'DAYS')
         {                                                              
             input message: 'Can you approve this ??', submitter: Constants."${teamName}_APPROVERS"
        }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>#!/usr/bin/env groovy
  class Constants {
     static final LOGIN_APPROVERS = 'approver1,approver2';
     static final UI_APPROVERS = 'approver2,approver3';
  }
  </code></pre>
  
  <p>Below is how you call from the pipeline    </p>
  
  <pre><code>stage ('Ship to QA?'){
      echo "Waiting for QA approval"
      shipToQA('LOGIN')
  }
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-30T06:28:31.267Z
Answers: 2019-04-30T06:33:35.057Z
Answers: 2019-04-30T06:33:35.057Z
Answers: Radhika
Body: <p>I could find that “submitter” parameter accepts individual user IDs and external LDAP groups. But “Jenkins-local” groups defined by any authorization strategy are not working. I have a limitation not to use external LDAP groups.</p>
  
  <p>The workaround that I have used is define the comma separated list of individual users as a Jenkins global variable and manage the list from there. This gives a better maintainability. However, it mandates that the stage is wrapped within node. As the pipeline waits for the approver to approve this step, it holds a node instance and this causes the rest of the jobs to wait for available instances. Is there a way to use a Jenkins global variable outside of node for the input step?</p>
  
  <pre><code>node{
  stage ('Approve?')
  {
      timeout(time:2, unit:'DAYS')
      {
          input message: 'Can you approve this ??', submitter: MY_APPROVERS
      }
  }
  </code></pre>
  
  <p>}</p>
  
Comments: CC BY-SA 4.0
Comments: 2019-04-26T07:55:48.683Z
Comments: Got any solution? I'm Facing the same issue
Comments: pbms
Tags: <jenkins>
Title: Jenkins input pipeline step - Give submitter as a group
UserDisplayName: Radhika
ThreadText: # Jenkins input pipeline step - Give submitter as a group
  
  (Asked by: username_0 on 2018-08-29)
  
  I could find that “submitter” parameter accepts individual user IDs and external LDAP groups. But “Jenkins-local” groups defined by any authorization strategy are not working. I have a limitation not to use external LDAP groups.
  
  The workaround that I have used is define the comma separated list of individual users as a Jenkins global variable and manage the list from there. This gives a better maintainability. However, it mandates that the stage is wrapped within node. As the pipeline waits for the approver to approve this step, it holds a node instance and this causes the rest of the jobs to wait for available instances. Is there a way to use a Jenkins global variable outside of node for the input step?
  
  ```
  node{
  stage ('Approve?')
  {
      timeout(time:2, unit:'DAYS')
      {
          input message: 'Can you approve this ??', submitter: MY_APPROVERS
      }
  }
  
  ```
  
  }
  
  **Tags:** jenkins
  
  > **Comments:**
  > **username_1**: Got any solution? I'm Facing the same issue  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-04-30. Score: 1
  
  We have moved onto using Jenkins templates and I have a workaround to keep the individual approver names list in one place. Sharing the sample code for your reference.
  
  ```
  #!/usr/bin/env groovy
  import com.mm.Constants 
  def call(String teamName = 'LOGIN') {
     // team name of null means UI
     teamName = teamName ?: 'UI'
  
     timeout(time:2, unit:'DAYS')
         {                                                              
             input message: 'Can you approve this ??', submitter: Constants."${teamName}_APPROVERS"
        }
  
  ```
  
  }
  
  ```
  #!/usr/bin/env groovy
  class Constants {
     static final LOGIN_APPROVERS = 'approver1,approver2';
     static final UI_APPROVERS = 'approver2,approver3';
  }
  
  ```
  
  Below is how you call from the pipeline
  
  ```
  stage ('Ship to QA?'){
      echo "Waiting for QA approval"
      shipToQA('LOGIN')
  }
  
  ```
  
  
  ---
  
  