Hi Bjoern,
I have even tried that but I am won't get complex type as an response output with that custom scripting with JS/Groovy, I am not sure about the requirement which Jitendra has but for that Jitendra Kansal can give his inputs that was he able to make it for that.
Regards,
Fenil.