Hi Atlassian,
On the post PluginSettings how to manage? it states, "If the repository is deleted all the settings are removed." When I'm using PluginSettings to store data, and the repository is deleted and recreated with the same name under the same project, the data that was stored by the plugin before is retrieved. Below is how we're storing/retrieving the data - is there a different way to do it so the repo delete functions correctly?
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String pathInfo = req.getPathInfo(); String[] components = pathInfo.split("/"); String projectName, storedName, PROJECT_KEY; /* Check for valid repository */ if (components.length < 4) { resp.sendError(HttpServletResponse.SC_NOT_FOUND); return; } Repository repository = repositoryService.getBySlug(components[1], components[2]); if (repository == null) { resp.sendError(HttpServletResponse.SC_NOT_FOUND); return; } projectName = req.getParameter("d-fname"); //field in HTML PROJECT_KEY = repository.getProject().getKey(); PluginSettings pluginSettings = pluginSettingsFactory.createSettingsForKey(PROJECT_KEY); storedName = (String) (pluginSettings.get(repository.getSlug() + "." + PLUGIN_SETTINGS_PROJECT_NAME)); /* Do more data retrieval/manipulation */ pluginSettings.put(repository.getSlug() + "." + PLUGIN_SETTINGS_PROJECT_NAME, projectName); doGet(req, resp); }
Community moderators have prevented the ability to post new answers.
I believe you need to write an event listener service which deletes your settings on the repo delete event.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because writing plugins is a new topic for me, this would mean creating a new plugin and not adding to my existing one - correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add it to your existing plugin.
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.