I want to add configuration for the plugin and where to store the configuration data so that it can be accessed by any module of the plugin
Hi,
Usually com.atlassian.sal.api.pluginsettings.PluginSettingsFactory is used for this purpose. Please google in this direction.
i have gone through how to configure the admin page in jira i have found several ways such as the webwork, servlet, actionobject, pluginsettingsfactory.
Could you please help me with any links of the tutorial for pluginsettingsfactory?
as the tutorial in the documentation doesn't give much information about how to store and retrieve the values
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is good example: https://developer.atlassian.com/server/framework/atlassian-sdk/sal-code-samples/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your support @Aleksandr Zuevich . On researching about how to connect the web-item with pluginsettingsfactory i found that we can use servlet.
I found few documentations on the adminUI but unsure of the correct sequence in which I should follow them.
Could you please help me with any link of sample plugin or the correct sequence of following the documents?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be of great help if you could let me know that how can i retrieve the stored value in a different REST module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Usually I create Settings class which I inject everywhere I need to use it:
@JiraComponent
public class Settings {
private static final String AUTO_UPDATED_FIELD_KEY = "autoupdated.field.id";
private final PluginSettings pluginSettings;
@Inject
public Settings(@ComponentImport PluginSettingsFactory pluginSettingsFactory) {
pluginSettings = pluginSettingsFactory.createSettingsForKey(getClass().getPackage().toString());
}
public void putAutoUpdatedFieldId(String fieldId) {
pluginSettings.put(AUTO_UPDATED_FIELD_KEY, fieldId);
}
public String getAutoUpdatedFieldId() {
return (String) pluginSettings.get(AUTO_UPDATED_FIELD_KEY);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.