Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Broken Permissions on Repository Access Tokens?

Yasir Kusay October 5, 2023

Hi, I created a repository access token for my repo. I was able to read the issues of the repo without any issue (using the repo access token), but when creating an issue, I got this error:

 

{"type": "error", "error": {"message": "Your credentials lack one or more required privilege scopes.", "detail": {"required": ["issue:write"], "granted": ["runner:write", "repository:delete", "pullrequest:write", "pipeline:variable", "webhook", "repository:admin"]}}}

 

I tried this again with a new repo access token, giving it all possible permissions.  I did not see anything that says you can't use this token for this purpose. Could I please get some help?

1 answer

1 accepted

1 vote
Answer accepted
Ash Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2023

Hi @Yasir Kusay 

 

Can you please provide a snippet of the repository permissions that you have configured for the access token? (feel free to blur out anything sensitive). 

See: https://support.atlassian.com/bitbucket-cloud/docs/repository-access-token-permissions/ 

 

Kind Regards,

Ash

Yasir Kusay October 5, 2023

No problem!

I ticked everything in that form.Screenshot from 2023-10-06 09-56-20.png

Yasir Kusay October 5, 2023

Screenshot from 2023-10-06 10-00-37.png

Ash Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2023

Hi @Yasir Kusay 

 

Thank you! 

 

Interesting, can you please elaborate a bit more on what you meant by "creating an issue"?

Are you creating pull requests? 

This could possibly be related to branch permissions if you have any restrictions there. 

 

Kind Regards,

Ash

Yasir Kusay October 5, 2023

Certainly.

I am trying to use the API repository access token to create an issue from command line, i.e. I am running the below:



curl --request GET \ --url 'https://api.bitbucket.org/2.0/repositories/workspace/repository/issue' \ --header 'Authorization: Bearer REPOSITORY_ACCESS_TOKEN' \ --header 'Accept: application/json' \
--data '{
"title": "Test issue Title"
'}

 This is what is giving me the error.

 

{"type": "error", "error": {"message": "Your credentials lack one or more required privilege scopes.", "detail": {"required": ["issue:write"], "granted": ["runner:write", "repository:delete", "pullrequest:write", "pipeline:variable", "webhook", "repository:admin"]}}}

 

Running a command to fetch my issues however works fine.

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.
October 5, 2023

Not supported yet, but there's a feature request for it: https://jira.atlassian.com/browse/BCLOUD-22603

Like # people like this
Yasir Kusay October 5, 2023

@Saxea _Flowie_ 

 

Oh, that makes sense. It also did not appear to work when I used it in `atlassian-python-api` module, even when just fetching issues.

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.
October 5, 2023

@Yasir Kusay can I kindly ask you to accept the answer if you found it helpful?

Also, maybe you can use app passwords as they support issues scopes? https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ 

Suggest an answer

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

Atlassian Community Events