jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

groovy.lang.MissingPropertyException: No such property: pullRequest for class: groovy.lang.Binding #85

Closed nishaprayaga closed 3 years ago

nishaprayaga commented 4 years ago

I am continuously getting below error when I try including pullRequest.comment in my jenkinsfile.

I have branch source plugin installed, Pipeline:github plugin installed.

node{

stages { stage('Test') { when { changeRequest() } steps { script { echo "Current Pull Request ID: ${env.CHANGE_ID}" } } } stage('Test2') { steps { script{

      pullRequest.comment("Your Pull request ${env.CHANGE_ID}  has been successful +artifact public id+link to it+the build is successful the version is not available to be deployed until it is merged back to the target branch and successfully built there")
    }
  }
}

} }

Error

groovy.lang.MissingPropertyException: No such property: pullRequest for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63)