Commercial Fixed Wing
Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Communication Breakdown; Confusion; Troubleshooting
ATC Issue All Types; Conflict Airborne Conflict; Deviation - Altitude Crossing Restriction Not Met; Deviation - Altitude Overshoot; Deviation / Discrepancy - Procedural Clearance
Air Traffic Control Issued Advisory / Alert; Flight Crew Became Reoriented
Human Factors; Environment - Non Weather Related; Staffing
While climbing on the ZZZ4 departure; ATC issued a turn to heading 265 and a climb to 17;000 feet. I read back the climb instructions; and both I and the Captain confirmed the instructions. While climbing through 8;300 feet; Departure asked if we were leveling at 8;000 feet; to which I responded; that our last instructions where to climb to 17;000 feet. Departure then instructed us to descend to 8;000 feet and turn left 30 degrees; at which time we received a TA and we acquired the aircraft visually. After the TA cleared; Departure issued a new climb clearance to 16;000 feet and we continued on to our destination.Conditions at the time were clear skies with low traffic chatter on the frequency; normal workload on climbout; and the Captain hand flew the aircraft to about 16;000 feet and all through the incident.Not sure there is any issue on the flight crew side; but perhaps ATC may have to look into this. I have noticed that the ATC staffing levels have changed since COVID and that they are working more than one frequency per Controller. Not sure if this was the case and was given wrong instructions by mistake.
During climbout from ZZZ; we switched to Departure and a received a clearance to turn to the west and a climb to 17;000 feet. FO; who was PM; read back the clearance and set the heading bug and 17;000 feet. This was also the clearance I heard and read back both of the changes to the PM. Approaching 8;000 feet Departure Control queried if we were leveling at 8;000 feet. As the PF I immediately started to correct back to 8;000 feet (highest I saw was 8;600 feet) and began a left turn as directed by ATC. During this time; we received a brief TA alert. As we were rolling out FO saw the traffic and called it out and said it was no factor. Almost immediately after that we received a clearance back to a heading of 270 and a climb to 16;000 feet.
Air carrier flight crew reported a clearance misunderstanding resulted in an altitude deviation and an airborne conflict during departure.  First Officer cited ATC staffing levels due to COVID-19 as a possible contributing factor in the miscommunication.