The previous 'triggerUrl' version causes a response similar to 'No git jobs using repository: http://gitblit-host/gitblit/git/repo.git'. The wroking url is 'http://gitblit-host/gitblit/r/repo.git'.
I also added brackets to improve readability
def jenkinsUrl = gitblit.getString('groovy.jenkinsServer', 'http://yourserver/jenkins')\r
\r
// define the trigger url\r
-def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=$url/git/$repository.name"\r
+def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=${url}/r/${repository.name}"\r
\r
// trigger the build\r
new URL(triggerUrl).getContent()\r