Yes. A connected account brings its option activity across with the rest: opens, closes, expiries and assignments.
An assignment arrives as what it is, a contract that turned into shares, so the share position that follows carries the premium with it instead of appearing from nowhere at the wrong cost.
Contracts loaded from a file behave the same way once they are in.
See the options tools