I have not done it, but the wire will all terminate within
the tailgate at connectors that will unplug. That is the only way they can wire a car.
Just take the new tailgate and remove the inner liner and trace out the wires to each termination point, should be fairly straightforward.
Wires should be at the 3rd brake light, one on either side of the defroster and one at the radio antennae(top 3 defroster lines). That should be all of the wires in that loom. Should be 3-4 plugs in total possibly 5 if the radio is plugged in on both sides, which I doubt.
As a help, tie string to the ends of each connector so as you pull them out you will be able to pull hte connectors back in from your wiring harness. Make sense? Just will save you lots of cursing and screaming trying to fish the wires through the metal is all.
I believe the interior fabric panel is on with clips, don't forget to remove the screw holding the pull handle on as well.
Just cut and splice. You'll have to pop off the center panel an C pillar panel.
Also this link is a workshop guide. But be warned you'll need to cross off some ads etc. Worth a read though as its a step by step guide to the boot:
https://workshop-manuals.com/audi/tt_quattro_coupe/v6-3.2l_(bhe)/body_and_frame/doors_hood_and_trunk/trunk/liftgate/trunk/liftgate_interior_trim_panel/component_information/service_and_repair/tailgate_trim_removing_and_installing/
Hope that helps.