Answers: <p>Have you installed the <a href="https://plugins.jenkins.io/build-user-vars-plugin/" rel="nofollow noreferrer">Build User Vars Plugin</a>? This plugin provides the &quot;BuildUser&quot; class.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-05-14T05:02:20.720Z
Answers: 2021-05-14T05:02:20.720Z
Answers: Kyanar
Body: <p>I preparing script in Jenkins as below where I getting error while build job. This job is send email to user for <code>input</code> for next step.</p>
  <pre><code> [Pipeline] End of Pipeline
   java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser
      at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:549)
      at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:473)
      ...
      ...
  </code></pre>
  <p>Version :</p>
  <pre><code>$ java --version
   openjdk 11.0.11 2021-04-20
  
  jenkins : 2.277.3
  </code></pre>
  <p>Pipeline code:</p>
  <pre><code>def user
  node {
  wrap([$class: 'BuildUser']) {
  user = env.BUILD_USER_ID
  }
  
  emailext mimeType: 'text/html',
               subject: &quot;[Jenkins]${currentBuild.fullDisplayName}&quot;,
               to: &quot;user@xxx.com&quot;,
               body: '''&lt;a href=&quot;${BUILD_URL}input&quot;&gt;click to approve&lt;/a&gt;'''
  }
  
  pipeline {
  agent any
  stages {
      stage('deploy') {
          input {
              message &quot;Should we continue?&quot;
              ok &quot;Yes&quot;
          }
          when {
              expression { user == 'hardCodeApproverJenkinsId'}
          }
          steps {
              sh &quot;echo 'describe your deployment' &quot;
          }
      }
     }
  }
  </code></pre>
  <p>Can anyone please review this, please ?</p>
  
Tags: <jenkins><automation><groovy><pipeline>
Title: java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser in jenkins
UserDisplayName: Nullpointer
ThreadText: # java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser in jenkins
  
  (Asked by: username_0 on 2021-05-03)
  
  I preparing script in Jenkins as below where I getting error while build job. This job is send email to user for `input` for next step.
  
  ```
   [Pipeline] End of Pipeline
   java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser
      at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:549)
      at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:473)
      ...
      ...
  
  ```
  
  Version :
  
  ```
  $ java --version
   openjdk 11.0.11 2021-04-20
  
  jenkins : 2.277.3
  
  ```
  
  Pipeline code:
  
  ```
  def user
  node {
  wrap([$class: 'BuildUser']) {
  user = env.BUILD_USER_ID
  }
  
  emailext mimeType: 'text/html',
               subject: "[Jenkins]${currentBuild.fullDisplayName}",
               to: "user@xxx.com",
               body: '''<a href="${BUILD_URL}input">click to approve</a>'''
  }
  
  pipeline {
  agent any
  stages {
      stage('deploy') {
          input {
              message "Should we continue?"
              ok "Yes"
          }
          when {
              expression { user == 'hardCodeApproverJenkinsId'}
          }
          steps {
              sh "echo 'describe your deployment' "
          }
      }
     }
  }
  
  ```
  
  Can anyone please review this, please ?
  
  **Tags:** jenkins, automation, groovy, pipeline
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-05-14. Score: 1 | Accepted answer
  
  Have you installed the [Build User Vars Plugin](https://plugins.jenkins.io/build-user-vars-plugin/)? This plugin provides the "BuildUser" class.
  
  
  ---
  
  