Skip to content

Add a token connection

A token connection lets every project on the site sync with GitHub or Bitbucket through one access token that a Jira admin manages. Project admins choose the connection by name and never see or handle the token. For GitHub, the AssertThat GitHub App is usually simpler because it needs no token at all.

GitHub: a fine-grained personal access token (or a token from a machine user) with Contents and Pull requests set to Read and write on the repositories the connection should serve.

Bitbucket: a workspace access token with repository read and write. You can also use an API token together with the account’s username.

Give the token an expiry date that suits your security policy, and note it: when it expires, replace it in AssertThat (see below).

  1. In Jira, go to Settings (cog) > Apps > AssertThat BDD and open the Git connections tab.
  2. Select Add token connection.
  3. Enter a Name that project admins will recognise, choose the provider and paste the Access token.
  4. Optionally limit the connection:
    • Allowed repositories: one per line, either an owner or workspace (acme or acme/*) or one repository (acme/shop). Leave empty to allow any repository the token can reach.
    • Allowed projects: only these Jira projects can choose the connection. Leave empty to allow every project.
  5. Select Add, then Test the new connection from its Actions menu.

The token is stored encrypted. It’s never shown again, in Jira or in any API response.

  • Replace token (in Actions): from the next sync, every project on the connection uses the new token, and the old one is discarded.
  • Delete: projects that use the connection keep their repository settings but stop syncing until a project admin chooses another connection or enters a project token.

Below the connections, Project tokens lists projects that sync with a token of their own instead of a connection, with who stored it and when. Token values are never shown. A Jira admin can Revoke a project token, for example when its owner leaves. That project then stops syncing until its admin chooses a connection.

A token connection can’t receive pushes on its own. For projects where the repository is the master, add the push webhook shown in the project’s Git integration to the repository. See Set up a project’s Git integration.