Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to Access content from JIRA to Confluence using JIRA gadget

ravi kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 10, 2018

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. 

1.JPG

 

But When I am adding this Gadget in Confluence, It is not getting the Projects. 

 

2.JPG3.JPG

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

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events