I wanted a way to find all components lead by a Lead Developer and list them on a Board’s Quick Filter. We have some leads that manage multiple components and needed a way to display all Lead Devs’ Components.
I could have created the jql to say:
component in (component2,component3)
but components could get added. The more constant variable was the developer username (greater chance of a component change than an employee change). This is what I used instead and I hear it’s an out of the box function; not from ScriptRunner.
component in componentsLeadByUser(kmcinerny)

I found help in the Atlassian Community: https://community.atlassian.com/t5/Jira-Questions/Create-a-JQL-Query-for-Component-owner/qaq-p/101589