// gitblit.properties or web.xml\r
def jenkinsUrl = gitblit.getString('groovy.jenkinsServer', 'http://yourserver/jenkins')\r
\r
+// define your jenkins access token here or set groovy.jenkinsToken in \r
+// gitblit.properties or web.xml (https://github.com/jenkinsci/git-plugin/#push-notification-from-repository)\r
+def jenkinsToken = gitblit.getString('groovy.jenkinsToken', 'yourtoken')\r
+\r
// define the repository base url\r
def jenkinsGitbaseurl = gitblit.getString('groovy.jenkinsGitbaseurl', "${url}/r")\r
\r
// define the trigger url\r
-def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=" + jenkinsGitbaseurl + "/${repository.name}"\r
+def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=" + jenkinsGitbaseurl + "/${repository.name}" + "&token=" + jenkinsToken\r
\r
// trigger the build\r
new URL(triggerUrl).getContent()\r