title: Jenkins pipeline MissingMethodException: No signature of method:
body: <p>I wrote a function to insert inject a variable through the EnvInj-plugin. Following script I used:</p>
  
  <pre><code>import hudson.model.*
  import static hudson.model.Cause.RemoteCause
  
  @com.cloudbees.groovy.cps.NonCPS
  def call(currentBuild) {
      def ipaddress=""
      for (CauseAction action : currentBuild.getActions(CauseAction.class)) {
  
          for (Cause cause : action.getCauses()) {
              if(cause instanceof RemoteCause){
                  ipaddress=cause.addr
                  break;
              }
          }
      }
      return ["ip":ipaddress]
  }
  </code></pre>
  
  <p>When I put it the the folder $JENKINS_HOME/workflow-libs/vars as a global function, i get the following error:</p>
  
  <pre><code>hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper.getActions() is applicable for argument types: (java.lang.Class) values: [class hudson.model.CauseAction]
  </code></pre>
  
  <p>I am completly new in groovy, so I don't know why it is not working. With the EnvInj-plugin it was fine. Can anyone help me?</p>