Is there a way to get group type Id by group name?
Discussion posts and replies are publicly visible
Did you try a!groupsByName()?
The Appian documentation, specifically the list of functions, is a great resource to find such things.