Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token

I have generated a token in VSTS/AzureDevops and applied the same in sonarcloud pullrequests and, while sonarcloud analyses my pull request branch and finds (expected) issues, these issues are not decorated in my PR as in the original post.

I’ve already tried creating a new token, but this doesn’t resolve the issue for me. What can I do to troubleshoot this connection?

Sharing the task ID of one of the PR’s AWhfgKz9VNr3bdSnvNRl

Thanks,
Siva

2 Likes

Did you give the token the required permissions, as explained on https://docs.microsoft.com/en-us/labs/devops/sonarcloudlab/index?tutorial-step=4?

Thanks for your response.

Initially we tried with giving access to Code(Read&write) as per documentation ,when it didn’t work we tried giving full access but still it didn’t work.Please advice.

@Fabrice_Bellingard Any updates ?

Hi,

Do you need any more details on this issue , Please let me know.

Thanks,
Siva

@Fabrice_Bellingard Do you have any updates ?

Hi Shiva,

I can see on your projects in SonarCloud that PRs have good names (i.e. not branch names). So it looks like you managed to get this solved, right?

I have the same issue.
Token has Read&Write permission on Code scope as per the documentation.
However, sonarCloud reports:

“Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token.”

Did something change on Azure DevOps or is something wrong with sonarCloud?

1 Like

Any update here? Bug?

I don’t think anything has changed on our side. Are you sure that the validity of your token is not expired?

Hi,

Its working fine now. I can able to see CodeSmell in all my PR’s.

@Fabrice_Bellingard Thanks for advice.

1 Like

Hi Shiva Kumar,

Did your token expired or it is worked automatically ??

Team,

I’m facing a similar issue but the token has full rights despite that Pull Requests are not getting completed.