Groovy web console

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

Untitled

Published 11 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
assigneeListString = "u1:u1@m.com:g1,u2:u2@m.com:g1,u3:u3@m.com:g2,u4:u4@m.com:g1"

TreeMap<String, List> groups = [];
assigneeListString.split(",").each { item ->    
    tokens = item.split(":");
    group = groups.get(tokens[2], []);
    group.add([assignee: tokens[0], email: tokens[1]]); 
    groups.put(tokens[2], group);
}

groups;