How to create the dynamic json payload

Hi Guys,

I want to create a dynamic JSON Object in the groovy script for the rest payload.
I am able to take the input array but unable to create the JSON from it, please help.