Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I configure Jenkins to interact with Bitbucket Cloud secured by Okta?

We have a corporate Bitbucket Cloud team set up with all of our access mediated by Okta. I would like to connect the Jenkins Multibranch Pipeline plugin to our Bitbucket repositories as described here:

We have created a separate automation account in our organization, with an associated Okta identity. I have configured MFA for both Okta and Bitbucket as required by the Bitbucket-Okta integration. This is, for all intents and purposes, a full-fledged Bitbucket account with all the same access as my developer account.

I have followed the aforementioned guide to the letter, creating credentials in Jenkins with the automation account's username and password. However, when I attempt to run the pipeline, and the plugin attempts to scan our target repository, it receives a 401 HTTP response from the Bitbucket API endpoint.

Has anyone managed to accomplish this integration, and if so, how did you do so? The end goal of this is to enable Jenkins build status updates to feed back into comments of the PR that triggered it (and other neat review/tracking features).

2 answers


Instead of doing a repository scan, may I recommend that you try setting up the Generic Webhook Trigger Plugin ?

At the moment I think that it is the best way to tell Jenkins to run a job. In each webhook payload from Bitbucket Cloud there will be a commit id. Extract that commit id, put it in an environment variable and then use it as the 'branch source' for the git checkout at the start of your build.

Then at the end of each build, you can use the Bitbucket Cloud build status notifier plugin to add feed back to pull requests (including direct links to green and red builds). Unlike the trigger step, this plugin will require OAuth credentials.

Good luck!


Hi @David Kushner

Were you able to find a solution for this.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

173 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you