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.
Specify the appropriate features as 'required' in your gadget XML, include the necessary resources in the CDATA section, and use the useOauth parameter when constructing your gadget:
<Require feature="oauthpopup" />
#oauth
#requireResource("com.atlassian.jira.gadgets:common")
#includeResources()
useOauth param:
var gadget = AJS.Gadget({
baseUrl: "__ATLASSIAN_BASE_URL__",
useOauth: "/rest/gadget/1.0/currentUser",
...
AJS.$.ajax({
url: "/rest/gadget/1.0/filtersAndProjects",
type: "GET",
data: ({projectsOnly : "true"}),
dataType: "json",
success: function(msg) {
alert(msg);
}
});
Gadget Developers' JavaScript Cookbook
Using the Atlassian Gadgets JavaScript Framework