Jira Gadget User Pref Save - error: no element found - preferences not saved.

I have a Jira 5.0 gadget specified with javascript and implemented as stated in tutorial mostly copied from J-tricks. The configuration descriptor contains multiple select fields which values are filled with REST (shortened code):

config: {
  descriptor: function (args) {
  var gadget = this;
  return {
    fields: [
    {
      userpref: "searchfield1",
      label: "abc",
      description: "def",
      type: "select",
      selected: gadget.getPref("searchfield1"),
      options: args.searchfields
  },
  ...
  ...
  ,AJS.gadget.fields.nowConfigured()
  ]};
},
args: [{
  key: "searchfields",
  ajaxOptions: function() {
    return {
      url: "/rest/eea-cf-search/1.0/gadget/searchfields"
    };
  }
}]

The problem is when I save the preferences in the gadget. Browsers javascript console produces an "no element found" error. The preferences are stored, but just for ONE time. After refreshing the page I must configure it again (what is an unwanted scenario). When searching for it I just found an older Jira issue. When viewing the HTTP response upon saving the preferences I see:

Request URL: /jira/rest/dashboards/1.0/10100/gadget/10203/prefs
Request Method: POST
Status Code: HTTP/1.1 204 No Content

Am I missing something?

1 answer

Okay, I forgot to add

<UserPref name="searchfield1" datatype="hidden" default_value="-1"/>

But the error message "no element found" is still there. Maybe it is related to missing data for the view (image included).

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

137 views 5 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you