It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

AJS.$.ajax async: false does not work in confluence

 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),
}
};
}
}]

1 answer

1 accepted

0 votes
Answer accepted

move the AJS.$.ajax to view section, it works

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

261 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you