You cannot do this with the standard JQL in JIRA. You'd have to write something custom to make it work.
That said, there is an easy way to enable something like this, but it will only work with tickets going forward, not with any comments or participation already in place.
The JIRA Toolkit Plugin will give you a Participants field which you can add as a custom field to every type and in a global context (or with any other config you chose). The participant field will track anyone who comments on a ticket, raises a ticket, or is the CURRENT assignee. Unfortunately, it does not keep a history of all assignees. This can be remedied by making comments required for actions that involve reassignment (Assign to, resolve, etc).
The Participant field can then be queried.