I am writing a jira gadget, but the ajax async works on Jira dashboard but doesn't work in confluence external gadget.
In Jira Dashboard both mapNum and mapProjectList are identified but in Confluence side, it seems running return and then mapNum and mapProjectList are identified. The async doesen't work. This is the code:
args: [{
key: "chart",
ajaxOptions: function () {
var mapProjectList=[];
var mapNum="";
AJS.$.ajax({
url: "/rest/api/2/search?jql=type=Initiative&fields=customfield_12001,project&maxResults=5000",
type: "GET",
dataType: "json",
async: false,
contentType: "application/json",
success: function generate(data) {
//setting mapNum and mapProjectList
});
return {
url: "/rest/initiativeparentlinkgadget/1.0/LenovoPiechartDefect/generatePieChartDefectImage",
data: {
mapNum:mapNum,
mapProjectList:JSON.stringify(mapProjectList),
}
};
}
}]
move the AJS.$.ajax to view section, it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.