Azure Devops Status check configuration with reset status breaks analysis

Must-share information (formatted with Markdown):

  • SonarQube version 2026.1 (Developer Edition)
  • Deployed via Docker in a Kubernetes cluster

We would like to have status check in Azure DevOps for SonarQube and everything works fine, until we enable “Reset status whenever there are new changes”.

We want to enable this to ensure the latest push is analysed. Unfortunately the analysis fails with the following message when trying to publish the status check:

Pull Request decoration failed: Unable to contact Azure DevOps Server: Pull request status rejected by status policy. Policy configuration requires status to be posted on iteration

This is due to the fact that the request that is being sent Azure is missing the iterationId in the body. The iterationId should be requested, in addition to the PullRequest information.

Hi,

It sounds like SonarQube can’t talk to your ADO instance. The docs should help.

 
Ann

Hi Ann,
we are also facing an issue, if a new commit is pushed to the PR the ci builds are getting success but the status checks kept waiting when Reset status whenever there are new changes is checked. You kept asking why use reset toggle and not provided proper solution in this topic

why develop that option?

Hi @Suvishesh,

Welcome to the community!

Have you checked the docs I referenced above? Have you checked your server logs?

 
Ann

It can definitely talk to Azure DevOps. It simply leaves out the iterationId in the request from SonarQube. If we would disable “Reset status whenever there are new changes” it does work.

Hi @sebastiaanspeck,

Could you elaborate on this? And what do your server logs say?

 
Thx,
Ann

The logs show somewhat the same like: Pull Request decoration failed: Unable to contact Azure DevOps Server: Pull request status rejected by status policy. Policy configuration requires status to be posted on iteration.

SonarQube should do an extra request to retrieve the current PR iterationId (Pull Request Iterations - List - REST API (Azure DevOps Git) | Microsoft Learn) which should be added to the request body of Pull Request Statuses - Create - REST API (Azure DevOps Git) | Microsoft Learn

Hi,

You’ve previously said that SonarQube can talk to ADO. Do other entries in the server log before and after this^ indicate that?

You think it’s not that SonarQube can’t talk to ADO but that ADO is rejecting the request?

 
Thx,
Ann

The message we get is a bit weird. It can talk to ADO, but ADO rejects the request due to the missing iterationId.

Exactly! The request is missing an important detail if you enable “Reset status whenever there are new changes” in ADO.

Hi,

Thanks for clarifying. I’m going to flag this for the team. Unfortunately, they’re facing resource constraints at the moment, so I’m not sure when they’ll be able to take a look.

 
Ann

1 Like