{jenkins-plugin-info:github-issues} |
This plugin allows you to create a GitHub issue whenever your build fails. Once the build starts passing again, the issue will automatically be closed. |
Report bugs here: http://dl.vc/jenkins-github-issues-bug (you will need to first create a Jenkins account at https://accounts.jenkins.io/)
In Manage Jenkins → Configure System → GitHub → GitHub Servers, ensure at least one GitHub server is configured and the "Test connection" button works.
Once this has been configured, add "Create GitHub issue on failure" as a post-build action:
When your build fails, a GitHub issue will be opened.
The default template used for the issue title and body can be changed in the GitHub Issue Notifier section in the Jenkins settings:
This template can also be modified per job. The "Content Token Reference" section at the bottom of the settings pane can be used to get information about all the available tokens.
When using the great job-dsl plugin, you can configure a publisher step as follows:
job(String name) { publishers { gitHubIssueNotifier { } } } |
All the advanced settings are available as optional configuration properties. To see all the available properties, go to the Job DSL API viewer at JENKINS_URL/plugin/job-dsl/api-viewer/index.html
and search for gitHubIssueNotifier
.
You can modify the global config using a system groovy script, i.e. add a init.groovy
to the JENKINS_HOME
dir.
import org.jenkinsci.plugins.githubissues.GitHubIssueNotifier def descriptor = Jenkins.instance.getDescriptorByType(GitHubIssueNotifier.DescriptorImpl) descriptor.issueTitle = 'ISSUE TITLE TEMPLATE` descriptor.issueBody = 'ISSUE BODY TEMPLATE` descriptor.issueLabel = 'LABELA LABELB` descriptor.save() |
In the templates you can use all available tokens using ${TOKEN
} notation. To see all available tokens, click the help button on the right of the `Content Token Reference` label in the GitHub Issues section of the global configuration UI.
To configure the global GitHub config and the credential config, see the init.groovy example in the repo.
Configure a publisher step in a Jenkinsfile as follows:
script { properties([[$class: 'GithubProjectProperty', projectUrlStr: '<GitHub repo URL>']]) } ... step([$class: 'GitHubIssueNotifier', issueAppend: true, issueLabel: '', issueTitle: '$JOB_NAME $BUILD_DISPLAY_NAME failed']) |