Yes, if you would like to call a REST endpoint form a groovy script, can you get the endpoint that is defined in the tenant somehow? Like the way you access process instance variables with execution.getVariable()? The same endpoint definition that is used with REST call activity.
Yes, scripts and groovy have been enabled. The problem is that the runtime is unaware of endpointService. It needs to be defined somehow before calling. Referring to your other posts, it seems that you are injecting it with a bean. But is it your own mock implementation of EndpointService you are injecting or can you really access the endpoints defined in the tenant on Alfresco server runtime?