Hi Chris,the cable with the green end should be connected to the motor,solenoid.This is when you press on the key fob the tailgate should open.
It looks like someone has already removed the motor,solenoid.They are about £15 on ebay.
I already removed the old motor,solenoid & installed the one i bought from ebay.It was`nt new or great but after a few alterations finally worked.
I think if you are taking a chance buying a used one,only reason i say that is of the expeience i had.Ok buy not much power.
I also sprayed a little wd40 into the tailgate catch,also postioned the lower part that the catch went down onto,making the tailgate open.
It only takes a few minutes fixing the motor,solenoid,as i did it myself.Hope this helps.