I often see this line or a slight variant at the end of obituaries for Jewish people. Is there a specific custom relating to this phrase?
Maybe someone’ll see it this time around.
What do you mean by a specific custom? I’ve not heard that specific phrase (in English), although people I know will frequently wish each other that they should only have simchas (happy occasions), or should only see each other at simchas (ie there shouldn’t be any sad reasons for them to see each other) when they speak with the recently bereaved, or when they meet an acquaintance at a funeral or a shiva house. (Shiva - the immediate family (parents, siblings, spouse, and/or children) of the deceased spend one week in mourning, receiving visits from their friends and from those who knew the person who died.) As one is finishing up a shiva visit, there’s a phrase that one says that translates as ‘May G-d comfort you among the mourners of Zion.’