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
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.