Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to use JQL querys in a scheduled service??

I am programming a service within a plugin. It is a service that is programmed in the administration for automatic execution. I need to do JQL queries from it, but 0 records are always retrieved.
If the same query is executed within another action, it does return results. From the service, the AO query and the retrieval of data from objects such as the issue, the project, the history, ... work well, but not the JQL queries.
Any idea to be able to carry out that query from here?

public class UpdateDaysInsStatusService extends AbstractService{

public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException {
return getObjectConfiguration("UpdateDays", "services/updateDays.xml", null);

public void run() {

private void pruebajql (String estado) {
SearchService searchService = ComponentAccessor.getComponent(SearchService.class);
JqlQueryBuilder builder = JqlQueryBuilder.newBuilder();
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();

Query query = builder.buildQuery();
SearchResults<Issue> results;

try {
results =, query, PagerFilter.getUnlimitedFilter());
System.out.println(" filas encontradas: " + results.getResults().size());

} catch (SearchException e) {
// TODO Auto-generated catch block



1 answer

0 votes
Clark Everson Community Leader Oct 31, 2021

Hi Pablo,

Welcome to community!

I believe when working with this part of Jira you want to use SQL not JQL. JQL is for the graphical interface, not scripting, the database or the API.



Suggest an answer

Log in or Sign up to answer

Atlassian Community Events