The solenoid is really a big switch. It has two functions, send power to the starter and control the Bendix. The Bendix is the gear assembly that engages the flywheel. If the starter spins when you bypass the solenoid the starter is working. By jumping out the solenoid terminals both of which are "hot" by the way, you have tested the starter motor. You should be able to see at least one smaller gauge wire and the battery cable attached to the starter. With the key in the start position you should see about 12V on the small wire. If you have the 12v at that wire the solenoid is the most likely fault. If you don't have 12v at the small wire, you need to get a wiring diagram for the truck. You then have to follow the circuit back to find out where you do have 12v and where it stops. It could be a relay, the ignition switch or any wire in between. This is why the diagram is so important. Many times the engine control module is looking for several inputs to generate that 12v on the solenoid. It may be from the chip in the key, the I am in park switch, etc. Without the wiring diagram you are guessing.