Background The predictive value of an individual’s attitude towards painful situations and the status of his immune system for postoperative analgesic requirements are not well understood. These may help the clinician to anticipate individual patient’s needs. Methods Sixty patients, who underwent a laparoscopic cholecystectomy under standardised general anaesthesia, were included. The total analgesic requirements during the first 48 h were the primary endpoint (unitary dosage, UD). The individual’s attitude towards imaginary painful situations was measured with the Situational Pain Scale (SPS). The emotional status was assessed by the Hospital Anxiety and Depression Scale (HADS) and the inflammatory status by the neutrophil-to-lymphocyte ratio (NLR). Results Univariate analyses revealed a significant association between UD and SPS, HADS and NLR. A negative relationship between SPS and NLR (NLR = 0.820–0.180*SPS;R2 = 0.211;P < 0.001) and a positive relationship between SPS and HADS (HADS = 14.8 + 1.63*SPS; R2 = 0.159;P = 0.002) were observed. A multiple linear regression analysis showed that the contribution of NLR to the UD was the most effective. A mediation analysis showed a complete mediation of the effect of SPS on UD (R2 = 0.103;P = 0.012), by the NLR (SPS on NLR: R2 = 0.211;P = <0.001), the HADS (SPS on HADS: R2 = 0.159;P = 0.002). The variance in UD explained by the SPS was indirect and amounts to 46 % through NLR and to 34 % through HADS. Conclusions In this series, preoperative pain-related attitudes (SPS) were associated with the postoperative analgesic requirements (UD) after a cholecystectomy. Eighty per cent of this effect was mediated by the HADS and the NLR.