How to get task id once Sonar scanner runs

Must-share information (formatted with Markdown):

  • which versions are you using: Data centre edition version 9.9.1
  • how is SonarQube deployed: on vm
  • what are you trying to achieve: I need task id once my sonar scanner command runs. which I required to get further information about task
  • what have you tried so far to achieve this:

Hey there.

What do you need the task ID for?

If it’s to query the Quality Gate, I would suggest instead using sonar.qualitygate.wait

1 Like

Hi, thank you for your response

It’s not for Quality Gate…it required use in sonarqube api call to get information about task, these task information I need for input to my internal applications

Thanks.

You’ll need to look for the .scannerwork/report-task.txt fike. You’ll find the task as the ceTaskId

organization=colin-sonarsource
projectKey=colin-sonarsource_phpblazetest
serverUrl=https://sonarcloud.io
serverVersion=8.0.0.51682
dashboardUrl=https://sonarcloud.io/dashboard?id=colin-sonarsource_phpblazetest
ceTaskId=AYyBaqvSVSWgm4MW7lvx
ceTaskUrl=https://sonarcloud.io/api/ce/task?id=AYyBaqvSVSWgm4MW7lvx
1 Like

Hey thanks you so much for your help…I can get it