def get_ticket_relations(self):
        query = """
            SELECT ticket FROM ticket_custom
            WHERE name = 'code_comment_relation' AND
             (VALUE LIKE '%(comment_id)d' OR
              VALUE LIKE '%(comment_id)d,%%' OR
              VALUE LIKE '%%,%(comment_id)d' OR
              VALUE LIKE '%%,%(comment_id)d,%%')
            """ % {'comment_id': self.id}
        return set([int(row[0]) for row in self.env.db_query(query)])