Search code examples
jenkinsjenkins-pipelinejenkins-pluginsgithub-apighprb

Blue Ocean URL in commit status sent by GitHub Pull Request Builder plugin in Jenkins


I want to change the "Details" link attached to status reports in a github pull request to point to Blue Ocean view instead of regular jenkins job url.

I tried using env.JOB_DISPLAY_URL, but it's not being resolved properly and as a result status update is not sent. set parameter in job config

GitHub pull request #161 of commit a4724087b434ff4813271d9364e715ba6af47013, no merge conflicts.
Setting status of a4724087b434ff4813271d9364e715ba6af47013 to PENDING with url ${env.JOB_DISPLAY_URL} and message: 'Pipeline started'
Using context: Jenkins/CI
Could not update commit status of the Pull Request on GitHub.
org.kohsuke.github.HttpException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","field":"target_url","message":"target_url must use http(s) scheme"}],"documentation_url":"https://docs.github.com/rest/reference/repos#create-a-commit-status"}

I tried with double quotation marks and without. both don't work. Is there a way to do this?


Solution

  • Try setting the string without the env.

    ${JOB_DISPLAY_URL}
    

    This method seems to work when referencing environment variables in the Configure System page of Jenkins, so hopefully it works here too.