How to determine when server is ready to be interrogated

I use Bamboo job to trigger a sonarqube analysis.
The subsequent job uses the web api to request the number of new issues.
In the past (with Jenkins) I had to put in an arbitrary delay (eg 7 minutes) before trying to request the number of issues “createdAfter” the build time.
Is there a better way to ensure the server is ready to return the correct results?


Yes, you’re looking for webhooks. When the webhook call arrives, you know server-side processing is complete. And the payload includes all the metrics relevant to your Quality Gate, so if your Quality Gate includes issue-related conditions, those measures will be there.