A trolley is a container for loading printed circuit board (PCB) components, and a trolley optimisation problem (TOP) is an assignment of PCB components to trolleys for use in the production of a set of PCBs in an assembly line. In this paper, we introduce the TOP, a novel operation research application. To formulate the TOP, we derive a novel extension of the bin packing problem. We exploit the problem structure to decompose the TOP into two smaller, identical, and independent problems. Further, we develop a mixed integer linear programming model to solve the TOP and prove that the TOP is an NP-complete problem. A case study of an aerospace manufacturing company is used to illustrate the TOP which successfully automated the manual process in the company and resulted in significant cost reductions and flexibility in the building process.