All Versions
Gadgets and Dashboards 3.0Gadgets and Dashboards 2.0
Gadgets and Dashboards 1.0
More...
This page is part of the Gadget Developers' JavaScript Cookbook.
Documentation under development
<Optional feature="gadget-directory"> <Param name="categories"> JIRA Charts </Param> </Optional>
<UserPref name="isPopup" datatype="hidden" default_value="false"/> <UserPref name="projectOrFilterId" datatype="hidden" />
config: { descriptor: function () { var gadget = this; var filterField ; if (/^jql-/.test(gadget.getPref("projectOrFilterId")) || gadget.getPref("isPopup") === "true"){ // JQL has been passed in and we should place this in a hidden field filterField = { userpref: "projectOrFilterId", type: "hidden", value: gadgets.util.unescapeString(gadget.getPref("projectOrFilterId")) }; } else{ // Lets display the filter picker filterField = AJS.gadget.fields.filterPicker(gadget, "projectOrFilterId"); } return { action: "/rest/gadget/1.0/chart/validate", theme : "top-label", fields: [ filterField, { other field } ] }; } }
jql-<JQL-string>
. You don't want to display the filter picker.projectOrFilterId
and be able to deal with values of both formats - filter-<filterId>
and jql-<JQL string
Refer to the PieChart Gadget for an example of this.
Gadget Developers' JavaScript Cookbook
Using the Atlassian Gadgets JavaScript Framework