Build failed any new bug rise the sonarqube dashboard

Hi,

We are trying to if any new bug came in sonarqube dashboard, we need to fail jenkins jobs

Can you please any plugin or any solution for new bug rise failed the jenkins job, right now we are using 8.9 version

Hi,

Your first step is to set Bugs on New Code as a Quality Gate condition. Then you want to fail the pipeline for a failing Quality gate.

 
HTH,
Ann

HI,

I am faceing the belower error, if quality gate passed and failed also

quality.gates.jenkins.plugin.QGException: Expected status 200, got: 401. Response: 
	at quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:59)
	at quality.gates.sonar.api.SonarHttpRequester.getAPIInfo(SonarHttpRequester.java:47)
	at quality.gates.sonar.api.QualityGatesProvider.getRequesterResult(QualityGatesProvider.java:34)
	at quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:29)
	at quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:20)
	at quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:73)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:21)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:808)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
	at hudson.model.Build$BuildExecution.post2(Build.java:179)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:701)
	at hudson.model.Run.execute(Run.java:1914)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:100)
	at hudson.model.Executor.run(Executor.java:433)
Build step 'Quality Gates' marked build as failure
Finished: FAILURE

Hi,

A 401 status means ‘unauthorized’. Looks the credentials were missing from your Quality Gate status request. I would double-check my configuration versus what’s in the docs.

 
Ann

HI,

We have configured credentials, But still error