Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Access token and Branch permissions

Michele Virgilio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 7, 2025

Hello, we have branch permissions on a repository, and an access token used by jenkins for pushing some changes on it. 
The access token has repository:write premission, but jenkins receive always access denied error.

Is there a way to set permissions for access token on branch permissions or some other solution?

Thanks

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 8, 2025

Hi Michele,

Saxea _Flowie_ is right that this is a limitation, access tokens cannot be added to branch restrictions at the moment. I just wanted to add that the limitation exists for OAuth access tokens as well.

If you have a branch restriction that limits who can push to a certain branch, then you'll need to authenticate with a user who is allowed to push to that branch in the branch restriction. This could be either HTTPS credentials of the user (Bitbucket username and API token) or with SSH keys associated with the user.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2025

Hi @Michele Virgilio ,

This is a known limitation and is reported in BCLOUD-22400.

I don't think this limitation applies to OAuth tokens, so you could have you build do the whole OAuth dance, get the token and push as described here.

Another option is to just use SSH to connect to the repo.

Alternatively, Flowie, our addon has a Jenkins integration, which can send data to Jenkins when triggering the build. You could configure it in a way that Flowie generates and sends a Bitbucket valid token to Jenkins to be able to push the changes, so you don't have to do all the auth work above. You'll need assistance from our support to configure it in this way - you can reach us at support@flowie.app.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events