The invention relates to an arrangement in the hoisting apparatus (11) of a work machine, which hoisting apparatus includes a rotation device (12) equipped with connectors (13) for connecting pressure-medium lines (14) to the rotation device, a boom (15), from which the pressure-medium lines are arranged to be led to the rotation device, a pivoted joint (17) for suspending the rotation device on the boom, which pivoted joint includes two consecutive pivots (22, 23) in the longitudinal direction of the rotation device, the rotational axes of which pivots are arranged at right-angles to each other, and in which the pressure-medium lines are arranged to route between the lugs (24) of the pivot (22) on the boom side of the pivoted joint. The pressure-medium lines are arranged to route past the connectors of the rotation device in the longitudinal direction of the rotation device and to turn towards the connectors in order to form a hose loop (18) and to route to the connectors of the rotation device, which are arranged on both sides (A, B) of the rotation device related to a plane defined in the longitudinal direction of the boom and the longitudinal direction of the rotation device. In addition, the invention also relates to a hoisting apparatus of a work machine and a work machine.