Is there a reason you specifically want a script task? It makes things a bit cumbersome to write and test.
If you’re using the out of the box users and groups, the answers would be:
The initiator is stored as a variable (defined by flowable:initiator). This is the userId. Use this userId to fetch, via the identityService, the other bits of information.
If the script task is immediately after the user task, the transaction won’t have been committed yet. You could store the assignee id of the previous task using a TaskListener and put the id in a (transient) variable for example and use same mechanism in (1) to get the info.
You’d need to do a UserQuery for a particular group and simply loop over the results.
Thank you for the information. I need to do this in a Javascript or Groovy task because I need end-users who using the modeler application can set assignments dynamically.