<p>The answer, as it turns out, is not to use ghprb at all. Simply aim your entire github org at your Jenkins web-hook and you're done.</p>
<p>Per the <a href="https://support.cloudbees.com/hc/en-us/articles/115003015711-GitHub-Webhook-Organization-Folder" rel="nofollow noreferrer">Cloudbees support docs</a>, install the GitHub plugin and GitHub Branch Source plugin, then setup the org folder job as normal. Then, at your Github org, go to Settings, Webhooks, Add Webhook, and add your webhook. Give it Pull Request, Push, and Repository events.</p>

CC BY-SA 4.0
2021-08-02T15:25:37.130Z
2021-08-02T15:25:37.130Z
Cory Ringdahl
<p>I'm working on getting JobDSL working with organizationFolder (the seed job builds just fine), and ghprb. 'githubPullRequest' doesn't exist under JobDSL's organizationFolder/triggers section, but 'ghprbTrigger' does.</p>
<p>When I try a minimal config, I'm told:</p>
<pre><code>the following options are required and must be specified: adminlist, whitelist,
orgslist, cron, triggerPhrase, onlyTriggerPhrase, permitAll, 
autoCloseFailedPullRequests, displayBuildErrorsOnDownstreamBuilds,  
commentFilePath, skipBuildPhrase, blackListCommitAuthor,  
allowMembersOfWhitelistedOrgsAsAdmin, msgSuccess, msgFailure,  
commitStatusContext, gitHubAuthId, buildDescTemplate, blackListLabels,  
whiteListLabels, includedRegions, excludedRegions 
</code></pre>
<p>I put in some dummy values to alleviate their string &amp; boolean hunger, and am finally rewarded with:</p>
<pre><code>java.lang.ClassCastException: jenkins.branch.OrganizationFolder  cannot be cast 
to hudson.model.Job 
</code></pre>
<p>and a giant groovy/java error dump.</p>
<p>I don't know what that last error means or how to track it down. This is pretty frustrating. Any help would be appreciated. Thanks!</p>

<jenkins>
Jenkins JobDSL organizationFolder and ghprb - even possible?
Cory Ringdahl
# Jenkins JobDSL organizationFolder and ghprb - even possible?

(Asked by: username_0 on 2021-08-02)

I'm working on getting JobDSL working with organizationFolder (the seed job builds just fine), and ghprb. 'githubPullRequest' doesn't exist under JobDSL's organizationFolder/triggers section, but 'ghprbTrigger' does.
When I try a minimal config, I'm told:
the following options are required and must be specified: adminlist, whitelist,
orgslist, cron, triggerPhrase, onlyTriggerPhrase, permitAll, 
autoCloseFailedPullRequests, displayBuildErrorsOnDownstreamBuilds,  
commentFilePath, skipBuildPhrase, blackListCommitAuthor,  
allowMembersOfWhitelistedOrgsAsAdmin, msgSuccess, msgFailure,  
commitStatusContext, gitHubAuthId, buildDescTemplate, blackListLabels,  
whiteListLabels, includedRegions, excludedRegions 

I put in some dummy values to alleviate their string & boolean hunger, and am finally rewarded with:
java.lang.ClassCastException: jenkins.branch.OrganizationFolder  cannot be cast 
to hudson.model.Job 

and a giant groovy/java error dump.
I don't know what that last error means or how to track it down. This is pretty frustrating. Any help would be appreciated. Thanks!

**Tags:** jenkins


---

## 1 answers

### Answer by username_0 on 2021-08-02. Score: 1 | Accepted answer

The answer, as it turns out, is not to use ghprb at all. Simply aim your entire github org at your Jenkins web-hook and you're done.

Per the [Cloudbees support docs](https://support.cloudbees.com/hc/en-us/articles/115003015711-GitHub-Webhook-Organization-Folder), install the GitHub plugin and GitHub Branch Source plugin, then setup the org folder job as normal. Then, at your Github org, go to Settings, Webhooks, Add Webhook, and add your webhook. Give it Pull Request, Push, and Repository events.


---

