I am having a JobRunner that tries to use CQL using the CQLSearchService instance:
int count = this.getSearchService().countContent(cqlQuery);
However, this job fails to run every single time, as the SearchService seems to lack permissions:
PermissionException: Not permitted to use confluence: null
How can I give permission to that service? Is there any other way to count certain content elements like macros without having to have certain permissions?
Thank you.