Getting saved filter by id is throwing an error in Jira


I want to get saved filter by it’s id in java
I tried to add SavedFilterService as dependency in the constructor of the listener, however it is giving me this error:
used by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.atlassian.greenhopper.service.rapid.SavedFilterService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

I tried also to add @ComponentImport above the variable, however it prevented plugin from being uploaded

Any idea what’s the problem or any other alternative on how to get saved filter by id in jira (java)

Thanks in advance :slight_smile:

In order to get saved filter by id you can use SearchRequestManager like this (not tested):

package my.package;

import com.atlassian.plugin.spring.scanner.annotation.imports.JiraImport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public class JqlFilterService {
    private final SearchRequestManager searchRequestManager;

    public JqlFilterService(SearchRequestManager searchRequestManager) {
        this.searchRequestManager = searchRequestManager;

    SearchRequest getFilter(Long filterId) {
        return searchRequestManager.getSearchRequestById(filterId);
1 Like

Thanks it works :slight_smile: