Jira Gadget: Configuration Settings Not Retained on Reconfiguration

I built a Jira gadget with several configurable options, yet when reconfiguring, the settings are not saved. For instance:

if (/^qjx-/.test(myWidget.getSetting('pfKey'))){
  var savedValue = decodeValue(myWidget.getSetting('pfKey'));
} else {
  var savedValue = CustomField.initializePicker(myWidget, 'pfKey');
}

How can I ensure the gadget remembers its previous configuration?

I experienced a similar issue with configuration settings not being retained in a custom Jira gadget. In my case, the problem boiled down to not having a persistent state for the widget’s configuration. I solved it by making sure that the settings were stored in a location that wasn’t wiped out during reconfiguration. It was also important to ensure that any settings retrieval function correctly referenced a stored value rather than resetting it every time the widget was reloaded. Revisiting the Jira documentation to better understand the lifecycle of the gadget configuration was very instructive.

I faced a similar issue where my gadget settings were not being retained after configuration changes. In my case, the problem was related to the timing of when settings were written to persistent storage. I discovered that resetting the widget before the save function completed was causing the loss of configuration. By restructuring the code to delay the reset until after the settings were fully committed, I was able to maintain the previous settings. It was also helpful to utilize logging during the configuration process to identify which function was prematurely clearing the values.

hey, i had simlar issues. try deferring the save call untill the widget is fully loaded. i found shifting the timing helped, so the saved config isnt overwritten by a reset. also check for any race condtions after config changes.

Upon facing a nearly identical issue with my Jira gadget, I found that the main problem was the moment at which configuration data was being committed. I discovered that incorporating asynchronous saving routines helped, as device timing often led to data losses when settings were saved too early or too late in the reconfiguration process. My solution involved deliberately sequencing the save operation to occur right before the gadget resets, coupled with debugging logs to trace the configuration state. This change ensured reliable persistence of settings across reconfigurations.