Skip to main content

How it works

The Bitbucket connector indexes pull requests from a Bitbucket Cloud workspace. You can index the whole workspace, every repository in one or more projects, or specific repositories.
  • It indexes OPEN, MERGED, and DECLINED pull requests, with their titles and descriptions.
  • It also keeps the author, reviewers, state, created and updated times, and a link back to the pull request.
Onyx pulls new and changed pull requests every 30 minutes by default. You can change this under Schedule. Sync with Bitbucket is not offered. The access type can only be Everyone in Your Organization or Specific Groups.

Setting up

This connector works with Bitbucket Cloud only.

Authorization

The Bitbucket connector authenticates with an Atlassian API token.
1

Create a scoped token

In Bitbucket, open Settings → Atlassian account settings → Security → Create and manage API tokens and select Create API token with scopes.
2

Name the token

Give the API token a name and an expiry date, select Bitbucket as the app, then select Next.
3

Select scopes

Select these scopes and select Next:
  • Projects: read:project:bitbucket
  • Repositories: read:repository:bitbucket
  • Pull Requests: read:pullrequest:bitbucket
4

Create the token

Select Create token and copy the API token. It is shown once and cannot be retrieved later.
For the most up-to-date instructions, refer to the official Bitbucket documentation.

Indexing

1

Connect a Bitbucket account

In Onyx, go to Admin Panel → Connectors and select Bitbucket. Under Authentication Account, select New Bitbucket Account and enter:
  • Bitbucket Account Email: The email address of the Atlassian account that owns the token.
  • API Token: The API token you created. Bitbucket account form
2

Choose what to index

  • Workspace: The workspace slug from your Bitbucket URL, https://bitbucket.org/{WORKSPACE}/....
  • Bitbucket Content to Index: Pick one tab.
  • Specific Repositories: Enter comma-separated Repository Slugs, such as repo1,repo2.
  • Project(s): Enter comma-separated Project Key(s), such as PROJ1,PROJ2, to index every repository in those projects.
  • Workspace: Index every repository in the workspace that the account can read. Bitbucket connector form
3

Choose who can see the pull requests

Under Document Access, select Everyone in Your Organization or Specific Groups. Specific Groups is available on Onyx Cloud and Enterprise Edition.
4

Create the connector

Select Create Connector. Onyx checks the token and workspace before it saves the connector. Open Admin Panel → Indexing Status, select the connector, and confirm its first indexing attempt completes.