@boyter It might be better to just explicitly list all of them on that page, but there are a lot!
That page does say “In fact you can deduce all the parameters from the API JSON object.” and indeed that’s the trick!
You can see an example pullrequest object here: https://api.bitbucket.org/2.0/repositories/atlassian/bbql/pullrequests
This means you can use the following for context parameters:
As for what the “root” variables are that are accessible on the page, it can be assumed by where you are in the UI. If you’re on a repository page,
pullrequest won’t be available and
user is available everywhere as the authenticated user.