I am using Git pull request builder plugin in Jenkins to link the Pull requests to Jenkins. Jobs are triggered with hooks and everything runs smoothly.
Nevertheless,
I couldn't find a plugin doing it, so I did using curl. Here is my groovy function
def call(def text_pr) {
def repository_url = scm.userRemoteConfigs[0].url
def repository_name = repository_url.replace("git@github.com:","").replace(".git","")
withCredentials([string(credentialsId: '', variable: 'GITHUB_TOKEN')]) {
sh "curl -s -H \"Authorization: token ${GITHUB_TOKEN}\" -X POST -d '{\"body\": \"${text_pr}\"}' \"https://api.github.com/repos/${repository_name}/issues/${ghprbPullId}/comments\""
}
}