Hi dave,
I create a simple query that does the job
select p.party_name from party_names p, acs_rels r
where r.object_id_two = p.party_id
and r.rel_type = :member_state
and r.object_id_one = $group_id
now i am going to add it into the context in the tcl script and do the proper amends in include permissions on it