Hi All,
Need help in JIRA gadget.
I am working on JIRA gadget creation given in the document.
https://developer.atlassian.com/server/jira/platform/writing-gadgets-for-jira/
I am able to build the gadget and it is fetching list of project in JIRA Dashboard.
But When I am adding this Gadget in Confluence, It is not getting the Projects.
My Gadget.xml
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="__MSG_gadget.title__" directory_title="__MSG_gadget.title__" description="__MSG_gadget.description__">
<Optional feature="gadget-directory">
<Param name="categories">
JIRA
</Param>
</Optional>
<Optional feature="atlassian.util" />
<Optional feature="auth-refresh" />
<Require feature="views" />
<Require feature="settitle"/>
<Require feature="oauthpopup" />
#oauth
<Locale messages="__ATLASSIAN_BASE_URL__/download/resources/com.atlassian.gadget.plugins.jira-gadget/i18n/ALL_ALL.xml"/>
</ModulePrefs>
<Content type="html" view="profile">
<![CDATA[
#requireResource("com.atlassian.gadgets.publisher:ajs-gadgets")
#includeResources()
<h1>List of projects</h1>
<script type="text/javascript">
(function () {
var gadget = AJS.Gadget({
baseUrl: "__ATLASSIAN_BASE_URL__",
useOauth: "/rest/gadget/1.0/currentUser",
view: {
template: function(args) {
var gadget = this;
var projectList = AJS.$("<ul/>");
AJS.$(args.projectData.projects).each(function() {
projectList.append(
AJS.$("<li/>").append(
AJS.$("<a/>").attr({
target: "_parent",
title: gadgets.util.escapeString(this.key),
href: "__ATLASSIAN_BASE_URL__" + "/browse/" + this.key
}).text(this.name)
)
);
});
gadget.getView().html(projectList);
},
args: [{
key: "projectData",
ajaxOptions: function() {
return {
url: "/rest/tutorial-gadget/1.0/projects.json"
};
}
}]
}
});
})();
</script>
]]>
</Content>
</Module>
Please help me resolving this issue. Thanks in advance.
Regards,
Ravi Kumar