Groovy web console

subscribe to the feed Subscribe
to this
site
testing (via #groovywebconsole)
tweet this snippet Tweet
this
script

testing

Published 9 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def list1 = [[project_no:'0-10060', case_no:'01757560'], [project_no:'1-153246461', case_no:'02039960'], [project_no:'1-175858654', case_no:'01995271'], [project_no:'1-224323229', case_no:'01912596'], [project_no:'1-228256337', case_no:'02039596'], [project_no:'1-53795134', case_no:'02029418'], [project_no:'2-00073626', case_no:'01998455']]
def list2 = [[project_no:'0-10060', case_no:'01757560'], [project_no:'1-224323229', case_no:'01912596'], [project_no:'1-228256337', case_no:'02039596'], [project_no:'1-233412391', case_no:'02060631']]

def finalResult = (list1 + list2).groupBy { it.project_no }.collect { k, v -> [project_no:k, case_no:v.case_no] }

println finalResult