для массива значений используйте массив
import groovy.json.*
StringWriter writer = new StringWriter()
StreamingJsonBuilder builder = new StreamingJsonBuilder(writer)
def object=[
items:[
[id:111,txt:"--111--"],
[id:222,txt:"--222--"]
]
]
builder {
id( object.items*.id )
}
println writer
, возвращает {"id":[111,222]}