PluginSettingsFactory throws error

Hi,

I would like to use Plugin Settings for data storage of my JIRA plugin. I have already used PluginSettingsFactory once in my BitBucket plugin last month. So I am familiar with it. However, when I try to use the same in JIRA plugin, it throws this error:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.jira.plugins.condition.IsMasterAndAdminCondition': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.sal.api.pluginsettings.PluginSettingsFactory]: : No qualifying bean of type [com.atlassian.sal.api.pluginsettings.PluginSettingsFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.

I am trying to use this in Condition class of a web-item. This is how I imported it in the condition class.

//TODO: To fetch projet key settings from pluginsettings
    /*@ComponentImport
    private final PluginSettingsFactory pluginSettingsFactory;

    @Autowired
    IsMasterAndAdminCondition(PluginSettingsFactory pluginSettingsFactory){
        this.pluginSettingsFactory = pluginSettingsFactory;
    }*/

What am I doing wrong? Is the usage different in JIRA compared to BitBucket?

1 Like

Maybe you need to add the @Scanned Annotation to your condition class

1 Like

@M.Abdel-Mola Thank you. That worked.