I don’t think that will be possible. A build status is associated with a commit ID not a pull request. To us it makes sense to keep these concepts loosely coupled since a commit can be part of any number of branches (and PR’s) so querying by commit ID means one build status can be displayed in multiple locations (PRs, branch list, commit list, commit page).
In your earlier comment you said:
The idea is to count the amount build status that were posted vs the amount of comments posted (with some additional logic) to try and determine if the latest comment was posted.
I’m not sure what the “additional logic” is but, wouldn’t this still have a timing issue? The count could still be off either because no issue was found and no comment was posted or because the latest comment hasn’t arrived yet (also because an earlier build, or several, didn’t produce a comment). I’d expect older builds to be irrelevant. It comes down to whether there’s a build status for the
HEAD of the
fromRef and, if so, looking for a matching comment, right? If that’s the case the timing issue will always be present.
Have you considered establishing a “grace period” using
BuildStatus#getDateAdded? It’s not the best solution, but perhaps you could put a rule in place which says: if the build status is present but no comment has been received after X minutes the pull request can be merged