Callie and Arizona are going to trial — and according to the synopsis for the upcoming Season 12 installment of ABC's “Grey’s Anatomy,” only one of them will be leaving court with sole custody of their daughter.

But who will the judge choose to be the official guardian of Sofia (Eva Ariel Binder)? Well, both Callie (Sara Ramirez) and Arizona (Jessica Capshaw) will give the justice of the court a good reason for why they should get custody.

“Being a mother is the reason I’m still alive today,” Callie says in the promo video for episode 22, titled “Mama Tried.” Arizona gushes that she loves her child and wants Sofia to stay with her in Seattle.

In a previous episode, Callie’s girlfriend Penny (Samantha Sloyan) was awarded the prestigious Preminger Grant, which would require her to work in New York. Callie encouraged Penny to pack her bags, adding that she would accompany the red-headed doc on her exciting adventure. But Callie revealed she wanted to take more than just her clothes with her across the country — like her daughter, Sofia.

“I need to take a big step backwards,” Arizona said after Callie revealed her master plan. “Somewhere, sometime, you heard me say yes to this. You heard me say, ‘Yes, please, Callie, take my daughter across the country’, but I never said that.”

This began the messy custody battle between the two, which also ended up involving their friends. Callie and Arizona needed friends to speak on their behalf in court tell explain why Sofia should be in their custody. And in the trailer for episode 22, it looks like Meredith (Ellen Pompeo), Owen (Kevin McKidd) and Bailey (Chandra Wilson) will be taking the stand … but for who?

In episode 21, Meredith and Owen promised Callie that they would speak on her behalf, but they could change their minds before they enter the courtroom.

“Grey’s Anatomy” airs Thursdays at 8 p.m. EDT on ABC.