As we have seen, a JQL function allows us to define custom expressions or searchers. JIRA has a set of built-in JQL functions, the details of which can be found at http://confluence.atlassian.com/display/JIRA/Advanced+Searching#AdvancedSearching-FunctionsReference. In this recipe, we will look at writing a new JQL function.
JQL functions provide a way for values within a JQL query to be calculated at runtime. It takes optional arguments and produces results based on the arguments at runtime.
In our example, let us consider creating a function,
projects(), which can take a list of project keys and return all the issues in the supplied projects, for example,
project in projects("TEST", "DEMO").
This will be equivalent to