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.
Create the token
Section titled “Create the token”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).
Add the connection
Section titled “Add the connection”- In Jira, go to Settings (cog) > Apps > AssertThat BDD and open the Git connections tab.
- Select Add token connection.
- Enter a Name that project admins will recognise, choose the provider and paste the Access token.
- Optionally limit the connection:
- Allowed repositories: one per line, either an owner or workspace (
acmeoracme/*) 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.
- Allowed repositories: one per line, either an owner or workspace (
- 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 or remove a token
Section titled “Replace or remove a token”- 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.
Project tokens
Section titled “Project tokens”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.
Import on push with a token
Section titled “Import on push with a token”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.