Could not find the pullrequest with key when integrating with Azure DevOps

Template for a good new topic, formatted with Markdown:

  • ALM used : Azure DevOps
  • CI system used : Azure DevOps
  • Scanner command used when applicable (private details masked)

INFO: Analyzing on SonarCloud
INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=405ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: Loading required plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=438ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=1030ms
INFO: Found an active CI vendor: ‘Azure DevOps’
INFO: Load project settings for component key: ‘XXXX’
INFO: Load project settings for component key: ‘XXXX’ (done) | time=415ms
INFO: Process project properties
INFO: Project key: XXXX
INFO: Base dir: D:\a\1\s
INFO: Working dir: D:\a\1.sonarqube\out.sonar
INFO: Load project branches
INFO: Load project branches (done) | time=427ms
INFO: Check ALM binding of project ‘XXXX’
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project ‘XXXX’ (done) | time=409ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=162ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 28.103s
INFO: Final Memory: 32M/110M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key ‘XXXX’

  • Languages of the repository: C#
  • Only if the SonarCloud project is public, Private repository
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  1. Create a repository with “master” and “develop/x.0” branch
  2. Create a feature branch from “develop/x.0” and push the changes
  3. Create a PR to merge changes from feature branch to “develop/x.0”
  4. PR fails with error “Could not find the pullrequest with key ‘XXXX’”
  5. PR is present in DevOps, but not present in SonarCloud
  6. New PAT token created with full access and set in azure PR analysis window in SonarCloud
  7. Running the pipeline directly without PR works perfectly fine.
  • Potential workaround: NIL

Hey there!

Can you check to see if you have a valid token set in the organization-level Administration > Organization settings > Azure DevOps connectivity management?

Hi Colin,

I also checked the organization PAT token, it says as valid and green tick icon is shown.

-Rinu

Thanks. I’ll reach out for some private information.

Thanks Colin, I have responded to you via email.

Hi Team,

Any update for me on this, its been 14 days since last update. I am being billed per month for the sonar cloud services but unable to use it with PR because of this issue. Could you please provide me an estimate of when this issue would be resolved? lot is riding on this evaluation of sonar cloud integration with our code.

Thanks,
Rinu