I'm trying to get the sum of story points, but only if the parent issue and the child issue are assigned to the same team. See screenshot example.

I have the structure grouped by team. Feature 4 is assign to Team A and it has 5 child stories. But there's 1 story assign to Team B.
How do I get the formula to work so that Team A total story points reads as 10 and not 11?
Currently my formula:
