Hi all, wondering has anyone a DIY for fixing the wiring going to the boot lid on my E46?

Or, anyone able to help out or know where'd be able to sort it for me?

Boot only opens on the key and rear reg bulbs don't work when the boot is closed, but do when it's open. Can also hear the boot lid button working when the boot lid is open.

Thanks