Broken Permissions on Repository Access Tokens?
Asked by Yasir Kusay:

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?


Answers:
author: Ash Yadav
body: Hi [@Yasir Kusay](/t5/user/viewprofilepage/user-id/5333120)

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

comments: author: Yasir Kusay
body: No problem!

I ticked everything in that form.![Screenshot from 2023-10-06 09-56-20.png](https://community.atlassian.com/t5/image/serverpage/image-id/284809iD4F01D5B81F2731E/image-size/large?v=v2&px=999 "Screenshot from 2023-10-06 09-56-20.png")


author: Yasir Kusay
body: ![Screenshot from 2023-10-06 10-00-37.png](https://community.atlassian.com/t5/image/serverpage/image-id/284811i70F1DB9E9E813E3B/image-size/large?v=v2&px=999 "Screenshot from 2023-10-06 10-00-37.png")


author: Ash Yadav
body: Hi [@Yasir Kusay](/t5/user/viewprofilepage/user-id/5333120)

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


author: Yasir Kusay
body: 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.


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


author: Yasir Kusay
body: [@Saxea _Flowie_](/t5/user/viewprofilepage/user-id/5230209)

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.


author: Saxea _Flowie_
body: [@Yasir Kusay](/t5/user/viewprofilepage/user-id/5333120) 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/>


Tags: bitbucket-cloud

cloud