Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook not sending pull request ID to Jenkins #181

Open
alhanger opened this issue Jan 11, 2017 · 1 comment
Open

Webhook not sending pull request ID to Jenkins #181

alhanger opened this issue Jan 11, 2017 · 1 comment

Comments

@alhanger
Copy link

Before our builds run Jenkins executes a Groovy script to set a description for the build which contains a hyperlink back to the pull request, as well as the pull request ID. A link to the pull request is still being set in the description, but the pull request ID is null. Here is the Groovy script.

def currentBuild = Thread.currentThread().executable
def PULL_REQUEST_URL = build.buildVariableResolver.resolve('PULL_REQUEST_URL')
def PULL_REQUEST_ID = build.buildVariableResolver.resolve('PULL_REQUEST_ID')
def description = "<a href='$PULL_REQUEST_URL'>PR #$PULL_REQUEST_ID</a>"
currentBuild.setDescription(description)

It is not clear if the resolve() method is returning null, or if the ID is simply not sent in the payload (my hunch is the latter). This recently started occurring after upgrading our version of Webhook to Jenkins. Any help is greatly appreciated.

@r4d1um
Copy link

r4d1um commented May 15, 2017

https://dengelonsoftware.blogspot.de/2017/01/jenkins-pull-request-and-pipeline.html

Parameters
Parameterize the build with the following options:
PULL_REQUEST_URL : string
PULL_REQUEST_ID: string
PULL_REQUEST_TO_BRANCH: string

Need to be added to the Job Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants