It's not possible in the aggregation pipeline. There is no method to convert the type.
Can you change the type of "assignedId" in the Tasks collection to ObjectId ?
Else you have to do it in code, convert the ObjectId to a String and use in in another query.