Documentation for JIRA 4.1. Documentation for other versions of JIRA is available too.

All of the objects defined externally to these methods are available to a JIRA plugin via dependency injection.

   /**
     * Retrieve a list of all the issues in the current project. Note that several of these objects are passed via
     * dependency injection as constructor parameters.
     *
     * @return list of Issue objects
     */
    public List<Issue> getAllIssuesInCurrentProject()
    {
        final  JqlQueryBuilder builder = JqlQueryBuilder.newBuilder();
        builder.where().project(currentProjectId);
        Query query = builder.buildQuery();
        try
        {
            final SearchResults results = searchService.search(authenticationContext.getUser(),
                    query, PagerFilter.getUnlimitedFilter());
            return results.getIssues();
        }
        catch (SearchException e)
        {
            log.error("Error running search", e);
        }

        return Collections.emptyList();
    }