B757 Undifferentiated or Other Model
Flight Crew Air Transport Pilot (ATP); Flight Crew Multiengine; Flight Crew Instrument
Flight Crew Last 90 Days 150; Flight Crew Total 18000; Flight Crew Type 3000
Communication Breakdown; Human-Machine Interface
Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Air Traffic Control Issued New Clearance; Flight Crew Returned To Clearance
Company Policy; Procedure; Human Factors
Preflight aircraft with intent to go to ZZZ-ZZZ1-ZZZ2 as [Flight] #XXXX for both legs. [During] early stages of preflight to ZZZ1; we received notice the leg to ZZZ1 was canceled and that we would be flying to ZZZ2 two hrs from that moment; so we call to [go] back inside to get paperwork and wait it out. We return to the same jet to preflight for ZZZ-ZZZ2 Flight #XXXX (same # as canceled ZZZ1 leg). ACARS initial page showed [Flight] #XXXX to ZZZ2. First Officer logs on to CPDLC for clearance and it comes in as [RNAV Departure] as filed. This is the same departure we were scheduled for our ZZZ1 leg earlier. We see the clearance and set cockpit up for [RNAV Departure]. We push; taxi; and takeoff with normal operations. We climb to FL340. While leveling off; ZZZ Center tells us we are cleared to [fix]. We reply that [the fix] is not on our [flight plan]. He says he is showing us filed [the fix]. We reply with our filed route to ZZZ2. He asked us to confirm we are going to ZZZ2 and we confirmed. Prior to [fix] on the [RNAV Departure]; and prior to any route deviation; he gives us present heading. A few minutes later he issues us a route to ZZZ2.  The mistake...Both Captain and First Officer miss that the CPDLC clearance that was received on our ZZZ-ZZZ2 [Flight] #XXXX preflight was for ZZZ-ZZZ1 [Flight] #XXXX. We taxi and takeoff as [Flight] #XXXX but ATC thinks we are going to ZZZ1 as [Flight] #XXXX and we think ZZZ2 [Flight] #XXXX.  Suggestion...changing the flight # for the leg once the first one is canceled or cancel the flight plan in the system once the flight is canceled by Flight Control. The flight plan was still in the system almost 3 hours later and our Flight Plane to ZZZ2 never came up in the clearance. We should never have 2 flight plan in the system with the same flight plan prior to taxi.
B757 Captain reported receiving an incorrect clearance via CPDLC because the ATC system had two flight plans for the same aircraft flight number.