Right now there's no way to create a query that uses the results of a previous request in an automated fashion. Those sorts of multi-stage queries are something we'd like to explore in the future.
If you just want to create a bucket for the max build number that you can then add sub-buckets to, you might be able to hack this together.
Create a new vis with a "Max build_number" metric on the y-axis. Create a "Split Chart" bucket with a terms agg of size 1 on the build_number field, ordered by the max metric. Now add whatever additional metrics and buckets you want. I think that's about as close as you'll get currently. See example below.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.