Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add Jenkinsfile usage

...

You can modify the global config using a system groovy script, i.e. add a init.groovy to the JENKINS_HOME dir.

Code Block
languagegroovy
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()

...

To configure the global GitHub config and the credential config, see the init.groovy example in the repo.

Usage in a Jenkinsfile

Configure a publisher step in a Jenkinsfile as follows:

Code Block
languagegroovy
script {
    properties([[$class: 'GithubProjectProperty',
                projectUrlStr: '<GitHub repo URL>']])
}

...

step([$class: 'GitHubIssueNotifier',
      issueAppend: true,
      issueLabel: '',
      issueTitle: '$JOB_NAME $BUILD_DISPLAY_NAME failed'])

Changelog

1.2.3 - 22nd July 2017

...