How to configure SonarCloud webhook for the integrated BitBucket Cloud?

We are using BitBucket Cloud and Sonar Cloud (paid legacy plan).
The scans are triggered on each PR.
We are willing to update builds status following scan issues status update.
For example if the issues were accepted → sonar webhook activated and sends status update to BB.
How can we achieve that?

Hey there.

Which status are you speaking about, specifically (feel free to a share a screenshot)?

SonarQube Cloud should already be updating PR Decorations when the issue status changes (such as when you accept the issue).

Hi, thanks for your reply.
We have Jenkins pipeline triggered on each PR creation/update.
As a part of this pipeline we are running sonar scan using jenkins sonar plugin.
Following the scan, we are checking for the quality gate status and if it fails, the build fails.
Thus the status of the sonarscan build on the PR is in a failure state and the merge is blocked following the merging policies restrictions.
What do we want to achieve?
In case the issue was accepted on the sonar side, we want the build status to be updated automatically in BB PR , in case the QG passes.
Or, should we run an additional scan in any case?

Please, see the screenshot attached.

Thanks

Thanks!

SonarQube Cloud is not going to update your build status if the Quality Gate changes. I’m not even sure it’s possible to mark a build in Bitbucket as successful after the fact and in fact, SonarQube Cloud does not know your build failed or what build executed the analysis.

What I think you actually want to be doing is, rather than polling for QG status and failing the build, using Pull Request Analysis/Decoration to issue a specific check on your PR that will be updated if the QG changes on the SonarQube Cloud side.

The tricky thing with Jenkins is that you need to set the pull request parameters yourself. You also need to make sure you have a bound project.