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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to read the pluginsettings in scheduler task?

I am able to store the configuration data in pluginsettings factory.

But I am unable to read it in my scheduler task code, Could you please guide me to fix this?

My code is here

@Scanned
public class ScheduledTask implements PluginJob {

private static final String PLUGIN_STORAGE_KEY = "com.jiradev.jira.plugins.dsconfigadmin";

//private static PluginSettingsFactory pluginSettingsFactory = null;
@ComponentImport
private final PluginSettingsFactory pluginSettingsFactory;

@Inject
public ScheduledTask(PluginSettingsFactory pluginSettingsFactory)
{
this.pluginSettingsFactory = pluginSettingsFactory;
}

public void execute(Map jobDataMap) {

PluginSettings pluginSettings = pluginSettingsFactory.createGlobalSettings();

System.out.println("Scheduler API Key: " + pluginSettings.get(PLUGIN_STORAGE_KEY + ".api_key") );

...

...

...

1 answer

1 accepted

0 votes
Answer accepted

I am able to get the pluginsettings using the below code.

PluginSettingsFactory pluginSettingsFactory = ComponentAccessor.getOSGiComponentInstanceOfType(PluginSettingsFactory.class);

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you